I am currently working on a game for mobile and have it so that there is a scrollbox on the level select screen (in UMG). Using blueprints, I have made it so that the scrollbox can be used by touching and dragging to scroll, thanks to the help of this thread:
My issue is that if I first touch a button to try to scroll, the “button pressed” event intercepts my input, so scrolling does not work. How would I ignore the button presses so that if a finger is moved, scrolling would begin? Then, if a button is tapped, the “button pressed” event fires. An example of what I mean is in the app “Words with Friends” (I’m sure there are many others as well).
Thanks for the response. If I were to use “button released” how would I be able to tell if there was finger movement from “button pressed” to “button released?” UMG widgets don’t have the “touch input” event that can detect when a finger is on the screen.
I saw the overridable functions “OnTouchStarted”, “OnTouchEnded”, and “OnTouchMoved” in the widget blueprint. These seem to have the same problem as above, where they will not be called if my first touch is on a button. From these OnTouch events I am able to “GetScreenSpacePosition” of the touch, so is it possible to somehow have these functions be called when a button’s “onpressed” event is called? Then, if there is no movement detected, I would use “onreleased” to call the button’s functionality.
For those who are for look for something similar for mobile, under button’s interaction category, you can also find a setting labelled ‘Touch Method’, set it to ‘Precise Touch’. You should be able to scroll over the buttons now.