I have made a custom button:
-> https://ibb.co/0DTh0vs
And I want to make it 2 status active and desactive (that change the text colour). The code that i attach to "HBoxContainer" Node is the next one:
func activate() -> void:
modulate = activateColor
func desactivate() -> void:
modulate = desactivateColor
func _on_mouse_entered() -> void:
print("mouse enter the button")
emit_signal("mouse_over_button", rect_position.y - rect_size.y/2)
activate()
func _on_mouse_left() -> void:
print("mouse left the button")
desactivate()
But this only work when the mouse cursor is directly touching the HBoxContainer node and don't work when is on the icon or the text and I want to works on all the surface of the button.
Any ideas?