challenge-editor/addons/popupwindow/pop_up_window.gd

19 lines
563 B
GDScript3
Raw Normal View History

2024-09-11 17:44:37 +08:00
extends CanvasLayer
const TEXT = preload("res://addons/popupwindow/pre/text.tscn")
func pop_up_control(control:Control,pos:Vector2):
for i in %Container.get_children():
i.queue_free()
%Container.add_child(control)
%Container.put_pos=pos
%Container.show()
pass
func pop_up_text(text:String,pos:Vector2,H_limit:float,label_settings:LabelSettings=LabelSettings.new()):
var new_text=TEXT.instantiate()
new_text.custom_minimum_size.x=H_limit
pop_up_control(new_text,pos)
new_text.set_label(label_settings)
2024-11-08 00:44:27 +08:00
new_text.set_mes(text)
2024-09-11 17:44:37 +08:00
%Container.show()
pass