frame-of-mind/src/logic-scenes/board/card.gd

29 lines
783 B
GDScript3
Raw Normal View History

2023-04-19 16:53:24 +00:00
@tool
extends Control
class_name Card
@export var text: String = "" :
set (value):
if is_inside_tree() or Engine.is_editor_hint():
$Label.text = value
text = value
@export var compatible_postits: Array[PostIt] = []
@export var voice_line: AudioStream = null
func _ready():
if not Engine.is_editor_hint() and is_inside_tree():
for postit in self.get_children(false):
self.compatible_postits.append(postit as PostIt)
$BackgroundSprite.frame = randi() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation)
2023-04-19 16:53:24 +00:00
$Label.text = self.text
func _process(delta: float) -> void:
pass
func _on_focus_entered():
print(self, "is focused")
func _on_focus_exited():
print(self, "is not focused")