mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(UI): 添加提示框组件及显示功能
实现提示框组件TipBox,包含显示和隐藏动画效果 在UIState中添加showTip方法用于显示提示信息 更新UI场景以包含提示框容器
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user