mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
25 lines
527 B
GDScript
25 lines
527 B
GDScript
|
|
@tool
|
||
|
|
extends PanelContainer
|
||
|
|
class_name TipBox
|
||
|
|
|
||
|
|
@export var text: String = "nothing"
|
||
|
|
|
||
|
|
@onready var label: Label = $%label
|
||
|
|
@onready var animator: AnimationPlayer = $%animator
|
||
|
|
|
||
|
|
func _ready():
|
||
|
|
label.text = text
|
||
|
|
animator.play("show")
|
||
|
|
func _process(_delta):
|
||
|
|
label.text = text
|
||
|
|
|
||
|
|
func destroy():
|
||
|
|
animator.play("hide")
|
||
|
|
await animator.animation_finished
|
||
|
|
queue_free()
|
||
|
|
|
||
|
|
static func create(applyText: String) -> TipBox:
|
||
|
|
var box = ComponentManager.getUIComponent("TipBox")
|
||
|
|
box.text = applyText
|
||
|
|
return box
|