#mouse entered event not working?

17 messages · Page 1 of 1 (latest)

lost delta
#

Im trying to get this Label object to turn different colors when hovered over, but the 'mouse entered' and 'mouse exited' events arent detecting. Its inside a control node, which has mouse filter pass through. Both the events and the label is connected to the code, so I dont really know what is happening:

(Its not printing so Ik its not a color issue)

extends Label

var def_color: Color = Color(1, 1, 1)
var hover_color: Color = Color(1, 0.77, 0.16)

func _ready() -> void:
self.modulate = def_color

func _on_mouse_entered() -> void:
self.modulate = hover_color
print("Mouse enter")

func _on_mouse_exited() -> void:
self.modulate = def_color
print("Mouse leave")

#

I want to follow up; Both having the mouse filter to STOP and PASS doesnt work.

autumn crow
lost delta
autumn crow
distant citrus
#

Is the signal on itself? Not sure if that is valid if it is

lost delta
distant citrus
#

That's alright

#

What shows up if you click on the green arrow?

#

Also, you don't need to do self.modulate, you can just use modulate

#

This is because the script is on the object you are affecting

lost delta
steady pivot
#

ui nodes have a mouse passtrough option, check how is set on your label

distant citrus
#

I would try putting the script on the control node and referencing the objects (the play label and others if you need to) from there

#

Then attaching the signal (the mouse entered) to the control node