online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/BarTextureButton.gd')
-rw-r--r--ui/BarTextureButton.gd7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/BarTextureButton.gd b/ui/BarTextureButton.gd
index cd3776a..4b21324 100644
--- a/ui/BarTextureButton.gd
+++ b/ui/BarTextureButton.gd
@@ -1,7 +1,7 @@
extends Control
class_name BarTextureButton
-signal pressed()
+signal pressed
var focused = false
@@ -14,15 +14,18 @@ export(Color) var pressed_color
onready var texture_button = $Texture
onready var background = $Background
+
func _ready():
texture_button.texture_normal = texture
texture_button.texture_focused = texture
texture_button.texture_pressed = texture
texture_button.texture_hover = texture
+
func _on_Texture_pressed():
emit_signal("pressed")
+
func _process(_delta):
if texture_button.pressed:
background.color = pressed_color
@@ -31,6 +34,7 @@ func _process(_delta):
else:
background.color = normal_color
+
func _on_Texture_mouse_entered():
focused = true
background.color = highlight_color
@@ -39,4 +43,3 @@ func _on_Texture_mouse_entered():
func _on_Texture_mouse_exited():
focused = false
background.color = normal_color
-