update void card so it can be used generally
This commit is contained in:
parent
2afd3876fc
commit
ace887b1d8
|
|
@ -10,6 +10,8 @@ var own_postits: Array[PostIt] = []
|
|||
if is_inside_tree() or Engine.is_editor_hint():
|
||||
$Label.text = value
|
||||
$BackgroundSprite.frame = text.hash() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation)
|
||||
|
||||
$BackgroundSprite.void_active = text == ""
|
||||
text = value
|
||||
@export var voice_line: AudioStream = null
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,17 @@ script/source = "extends AnimatedSprite2D
|
|||
@onready var initial_position = position
|
||||
var noise_position = randf()
|
||||
var noise: Noise = FastNoiseLite.new()
|
||||
|
||||
var void_active:
|
||||
set(become_void):
|
||||
if not (void_active == become_void):
|
||||
if is_inside_tree():
|
||||
$GPUParticles2D.is_void = become_void
|
||||
$GPUParticles2D.emitting = become_void
|
||||
$Sprite2D.is_void = become_void
|
||||
void_active = become_void
|
||||
|
||||
func _process(delta):
|
||||
if not State.reduce_motion:
|
||||
if void_active and not State.reduce_motion:
|
||||
noise_position += delta * 10
|
||||
|
||||
var random_position = Vector2(noise.get_noise_1d(noise_position*2), noise.get_noise_1d(-noise_position))
|
||||
|
|
@ -119,15 +126,19 @@ attractor_interaction_enabled = false
|
|||
[sub_resource type="GDScript" id="GDScript_vjwk7"]
|
||||
script/source = "extends GPUParticles2D
|
||||
|
||||
var is_void:bool = false
|
||||
|
||||
func _process(_delta):
|
||||
self.visible = !State.reduce_motion
|
||||
self.visible = !State.reduce_motion and is_void
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_tgc0b"]
|
||||
script/source = "extends Sprite2D
|
||||
|
||||
var is_void:bool = false
|
||||
|
||||
func _process(_delta):
|
||||
self.visible = State.reduce_motion
|
||||
self.visible = State.reduce_motion and is_void
|
||||
"
|
||||
|
||||
[node name="card" type="Control"]
|
||||
|
|
@ -139,7 +150,6 @@ offset_right = 150.0
|
|||
offset_bottom = 110.0
|
||||
focus_mode = 2
|
||||
script = ExtResource("1_6ceun")
|
||||
compatible_postits = Array[Resource("res://logic-scenes/board/post-it.gd")]([null, null, null])
|
||||
|
||||
[node name="BackgroundSprite" type="AnimatedSprite2D" parent="."]
|
||||
clip_children = 2
|
||||
|
|
|
|||
Loading…
Reference in New Issue