Announcement

Collapse
No announcement yet.

How to implement Mobile Swipe Scroll for UMG Scrollbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Click image for larger version

Name:	MouseCapture.png
Views:	1
Size:	68.0 KB
ID:	1145420

    How would you go about implementing swipe scrolling?

    #2
    Modify SScrollView and send us a pull request 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.

    Comment


      #3
      Thanks for the quick reply and suggestion! It's time to edit me some SScrollView!

      Comment


        #4
        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.

        Comment


          #5
          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.

          Comment


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

            Comment


              #7
              Hi all. Here's my solution blueprints.Click image for larger version

Name:	Pictures.PNG
Views:	1
Size:	214.5 KB
ID:	1075850

              Comment


                #8
                Thanks Cloudbase, your solution helped me a lot. I updated it a little to get smooth touch scrolling for the scroll box.
                Click image for larger version

Name:	Bildschirmfoto 2015-07-23 um 11.59.00.png
Views:	1
Size:	307.5 KB
ID:	1082289

                Comment


                  #9
                  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 :-)

                  capturing Touch Events:
                  Click image for larger version

Name:	Bildschirmfoto 2015-07-23 um 14.31.52.png
Views:	1
Size:	278.0 KB
ID:	1082298

                  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
                  Click image for larger version

Name:	Bildschirmfoto 2015-07-23 um 14.32.43.png
Views:	1
Size:	246.9 KB
ID:	1082299

                  Comment


                    #10
                    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

                    Comment


                      #11
                      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.
                      Project Developed: LingvoBot || CyberWar || YouTube ||

                      Comment


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

                        Comment

                        Working...
                        X