mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
ac77e3d581
- 将TipBox的Label改为RichTextLabel以支持富文本 - 添加主题文件支持多种字体样式 - 修改showTip方法支持自定义显示时长 - 添加Boss波次提醒功能 - 调整TipBox场景的布局和样式
25 lines
522 B
GDScript
25 lines
522 B
GDScript
@tool
|
|
extends PanelContainer
|
|
class_name TipBox
|
|
|
|
@export var text: String = "nothing"
|
|
|
|
@onready var label: RichTextLabel = $%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").instantiate()
|
|
box.text = applyText
|
|
return box
|