online multiplayer chess game (note server currently down)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
extends ColorRect
signal clicked
var circle_on := false
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
rect_size = rect_min_size
if Globals.spectating:
mouse_default_cursor_shape = CURSOR_FORBIDDEN
else:
mouse_default_cursor_shape = CURSOR_POINTING_HAND
func set_circle(boolean: bool) -> void:
circle_on = boolean
circle.visible = boolean
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()
|