mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
6be95a5658
实现提示框组件TipBox,包含显示和隐藏动画效果 在UIState中添加showTip方法用于显示提示信息 更新UI场景以包含提示框容器
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
|