How to implement Mobile Swipe Scroll for UMG Scrollbox

Hello fellow programmer/forumWanderer,
I want to implement what I label as “inertial swipe scrolling” for my game (basic IOS app scrollbox functionality) . However, I’ve had a lot of difficulty implementing this through blueprint. Will I have to override the widget c++ files to get this? The most I managed to find was an outdated c++ solution which no longer works. Can this be done in blueprint?

I had something going with using UMG’s scrollbox - Set Scroll Offset function when a widget is being touched, but the Has Mouse Capture function fails for the widgets now matter what. So I’m not sure how to find out when the scrollbox is being touched.

How would you go about implementing swipe scrolling?

1 Like

Modify SScrollView and send us a pull request :slight_smile: That’s the kind of thing that’s not easy to solve at the Blueprint level (making new layout panels is more of a C++ task) - rather the C++ widget is what should be improved. So either make a new Slate control that does what you want and wrap it with a UWidget, or modify the engine’s SScrollView.

Thanks for the quick reply and suggestion! It’s time to edit me some SScrollView! :slight_smile:

Take a look at SListView or maybe it’s in SBaseListView (not exact name). We added over-scroll and I believe inertia scroll for it, just haven’t done it for SScrollView yet.

Surely you mean ScrollBox instead of ScrollView (that doesn’t appear to exist). It appears that Inertial scrolling is already programmed in ScrollBox through the void tick function. So now I’m wondering why it’s not working. That or I’m just gravely misunderstanding something here. :confused:

Yeah, SScrollBox. It has Inertial scrolling for right click drag, but not for touch input causing it.

Hi all. Here’s my solution blueprints.

Thanks Cloudbase, your solution helped me a lot. I updated it a little to get smooth touch scrolling for the scroll box.

So i tweaked it further, now the scrolling is smooth and stops at the start and the end of the content of the scroll box. It’s kind of a workaround for the missing getscrolloffset feature. Version is UE 4.7.6, not tested on 4.8

Hope this helps anyone, cause i had major headaches till i solved it :slight_smile:

capturing Touch Events:

and finally in the widget-blueprint check the max and min offset values and set the offset. The “915” is the y-size of the scroll box

Hello, may i ask you how do you keep the HUD receiving swipe input,
i can click on my widget with mouse/touch, but all other input (keyboard, swipe) just disabled
i read that i need to add “enable input” but if i put that node to the widget BP it requires me to add target,
“self is not an actor” the error said

thanks

I build a custom swipe detection event in blueprint for my android game menu. I’m confused when I have scrollbox behind my touch swipe event doesn’t work. Touch only work when I remove the scrollbox or make it hit test invisible or on other widgets. Please help if anyone has an idea where the problem is.

Is this thread still the way to go about this in 2019, or have there been some further developments?

Hi,
I know that’s a long time since the last message, but I developped an UMG component to do this, it’s free and opensource on my github: