mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-21 13:16:49 +01:00
32 lines
678 B
GDScript3
32 lines
678 B
GDScript3
|
tool
|
||
|
extends Control
|
||
|
|
||
|
export var color = Color()
|
||
|
|
||
|
|
||
|
func _ready():
|
||
|
pass
|
||
|
|
||
|
|
||
|
func _draw():
|
||
|
var size = get_parent().rect_size
|
||
|
var pos = Vector2.ZERO #get_parent().rect_global_position
|
||
|
draw_outline_box(pos, size, color, 1)
|
||
|
|
||
|
|
||
|
func draw_outline_box(pos, size, color, width):
|
||
|
#Top line
|
||
|
draw_line(pos, pos + Vector2(size.x, 0), color, width)
|
||
|
#Left line
|
||
|
draw_line(pos, pos + Vector2(0, size.y), color, width)
|
||
|
#Bottom line
|
||
|
draw_line(pos + Vector2(0, size.y), pos + Vector2(size.x, size.y), color, width)
|
||
|
#Right line
|
||
|
draw_line(pos + Vector2(size.x, 0), pos + Vector2(size.x, size.y), color, width)
|
||
|
|
||
|
|
||
|
func _process(delta):
|
||
|
if not is_visible_in_tree():
|
||
|
return
|
||
|
update()
|