extends Button

class_name ControlPoint

var locked : bool = false

func _draw():
	draw_circle(size/2, 5, Color.DIM_GRAY, true, -1, true)
	draw_circle(size/2, 5, Color.WHITE, false, 1, true)

func get_represented_position() -> Vector2:
	return position + size/2

func set_represented_position(new_position : Vector2):
	position = new_position - size/2
	
	var parent = get_parent()
	if parent != null:
		parent.update()
	

func _process(delta: float) -> void:
	if button_pressed:
		set_represented_position(get_global_mouse_position())
