Godot-TextEditor/addons/text_editor/TE_DragLabel.gd

19 lines
513 B
GDScript3
Raw Normal View History

2021-10-11 18:41:26 +02:00
tool
extends RichTextLabel
var editor:TextEditor
func _ready():
add_font_override("normal_font", editor.FONT_R)
add_font_override("bold_font", editor.FONT_B)
add_font_override("italics_font", editor.FONT_I)
add_font_override("bold_italics_font", editor.FONT_BI)
func _process(_delta):
set_global_position(get_global_mouse_position())
func _input(e):
if e is InputEventMouseButton:
if (e.button_index == BUTTON_LEFT and not e.pressed) or (e.button_index == BUTTON_RIGHT and e.pressed):
queue_free()