Untitled

 avatar
unknown
python
2 years ago
733 B
11
Indexable
extends Control

var is_visible = true
var m_pos = Vector2(10,0)
var start_selection_pos = Vector2(0,100)
var selection_box_color = Color(0, 1, 0)
var selection_box_line_width = 3

func _draw():
	if is_visible and start_selection_pos != m_pos:
		draw_line(start_selection_pos, Vector2(m_pos.x, start_selection_pos.y), selection_box_color, selection_box_line_width)
		draw_line(start_selection_pos, Vector2(start_selection_pos.x, m_pos.y), selection_box_color, selection_box_line_width)
		draw_line(m_pos, Vector2(m_pos.x, start_selection_pos.y), selection_box_color, selection_box_line_width)
		draw_line(m_pos, Vector2(start_selection_pos.x, m_pos.y), selection_box_color, selection_box_line_width)

func _process(delta):
	update()
Editor is loading...