ajout d'une alerte de réussite/échec
This commit is contained in:
25
gui/game/alert/scripts/alert.gd
Normal file
25
gui/game/alert/scripts/alert.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
@tool
|
||||
extends VBoxContainer
|
||||
class_name Alert
|
||||
|
||||
@export var text = "" :
|
||||
set(t):
|
||||
text = t
|
||||
if is_node_ready():
|
||||
%Label.text = t
|
||||
|
||||
func appear(
|
||||
with_anim : bool = not visible
|
||||
):
|
||||
if with_anim :
|
||||
%AppearAnimationPlayer.play("appear")
|
||||
else:
|
||||
%AppearAnimationPlayer.play("shown")
|
||||
|
||||
func disappear(
|
||||
with_anim : bool = visible
|
||||
):
|
||||
if with_anim :
|
||||
%AppearAnimationPlayer.play_backwards("appear")
|
||||
else:
|
||||
%AppearAnimationPlayer.play("hidden")
|
||||
Reference in New Issue
Block a user