Tidy UP!
This commit is contained in:
parent
7ce2863cfd
commit
e216364ec1
12 changed files with 84 additions and 71 deletions
11
scripts/ui_utils.gd
Normal file
11
scripts/ui_utils.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class_name UIUtils
|
||||
|
||||
static func flip_label_text(label: Label, new_text: String, duration: float = 0.15) -> void:
|
||||
label.pivot_offset = Vector2(0, label.size.y)
|
||||
var tween = label.create_tween()
|
||||
tween.tween_property(label, "scale:y", 0.0, duration).set_trans(Tween.TRANS_CUBIC).set_ease(Tween.EASE_IN)
|
||||
tween.tween_callback(func():
|
||||
label.text = new_text
|
||||
label.pivot_offset = Vector2.ZERO
|
||||
)
|
||||
tween.tween_property(label, "scale:y", 1.0, duration).set_trans(Tween.TRANS_CUBIC).set_ease(Tween.EASE_OUT)
|
||||
Loading…
Add table
Add a link
Reference in a new issue