1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
extends ColorRect class_name BackgroundSquare signal clicked onready var circle := $CircleHolder/Circle func _ready() -> void: circle.rect_min_size = Globals.grid.piece_size / 4 circle.material.set_shader_param("color", Globals.grid.overlay_color) circle.visible = false rect_min_size = Globals.grid.piece_size if Globals.spectating: mouse_default_cursor_shape = CURSOR_FORBIDDEN else: mouse_default_cursor_shape = CURSOR_POINTING_HAND func _gui_input(event: InputEvent): if !Globals.spectating and event is InputEventMouseButton and Input.is_action_pressed("click"): emit_signal("clicked") get_tree().set_input_as_handled()