#Button Release Signal How to Use

1 messages · Page 1 of 1 (latest)

desert scarab
#

So I'm making a sort of GraphEdit alternative. Most of the things work, but I started using BaseButton as the extend class for the sockets now I can't click-drag from a socket to pull a wire that then connects to another socket on mouse button release.

The issue is that when you press down a UI button, it takes over jurisdiction of the mouse button. If I move the mouse out of the UI button before releasing the mouse button, it still emits a "button up" signal on that UI button.
Pressing the mouse button outside the UI button, then releasing on a button, also doesn't emit a "button up" signal. What's up with that?

I want to be able to press down one UI button, move to another UI button and release, getting some reference of both UI buttons.
Is there a way to change this behavior?

dense burrow
#

i dont think there is with the base button class, id probably say the best option is to make your own class that implements the behavior

desert scarab
#

Alright, I've re-implemented my sockets without the BaseButton.
Creating signals imitating a button, but according to func _input() worked.

#

Note for someone in the future. If you do this, it's better you also connect the signals mouse_entered and mouse_exited, which set a mouse_over boolean. You should only process input if the mouse is over or every instance of your custom button will be bogging down performance.