[UMG] Button Press & Release
Are there any plans for having OnRelease events implemented for UMG Buttons in future versions? In particular I'm wanting to implement "hold" functionality, but even trying to do a workaround is odd because the normal mouse/touch events don't fire when pressing UMG buttons, so I can't even set a state variable saying if the button is down or not.
There seems to be some of that functionality in the "Border" widget, but embedding a button inside a border takes away the mouse event functionality.
There is no current functionality for this. However, I will be sure to put in a feature request for this function. Until then I may have a possible work around for you to try.
Create a new widget and place only one button in this widget. You will need to disable this button within the behavior tab (this is to stop the button from consuming input of mouse click events).
This will be done inside your character blueprint. Create 2 custom events (I named them "MouseOver" and "MouseNotOver"). These will fire off depending on if the mouse is over the button. You will then need a bool variable (I named mine "IsOver"). This will be used to tell the branch if the mouse is over the button.
This will be done inside the widget blueprint. You will need to cast an "Event On Mouse Enter" to your character blueprint and to the custom event there in (in my case it is called "MouseOver"). Then you will need to cast an "Event On Mouse Leave" to your character blueprint and to the custom event there in (in my case it is called "MouseNotOver").
Add widget to view port.
This is Just an example. Please note that the button will be slightly grayed out and will not have a "click" animation. I hope this helps.
answered Oct 23 '14 at 05:41 PM
Rudy Q ♦♦ STAFF
I made a releasable button with C++. You can check it out here : http://www.barisatamer.com/button-with-release-event/
answered Feb 03 '15 at 06:21 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here