Hi,
I looking for to make an UI like Clash Royal.
Is there a solution to have a Scrollbox vertical inside a Scrollbox horizontal ?
My vertical scrollbox have priority so my parent scrollbox (horizontal) does not work anymore.
Any idea ?
Hi,
I looking for to make an UI like Clash Royal.
Is there a solution to have a Scrollbox vertical inside a Scrollbox horizontal ?
My vertical scrollbox have priority so my parent scrollbox (horizontal) does not work anymore.
Any idea ?
In this case the priority goes to whatever the cursor is over atm. If itâs over the inner scrollbox thatâs the one that will consume the input and scroll (providing it can scroll to start with).
How else would that work? You want a modifier button or an area that is excluded from scrolling so the outer element can take over?
Thanks for response.
Iâm agree with you.
Have you any idea to reproduce a Clash Royal UI ?
ScrollBox seem to not be a good ideaâŚ
done without ScrollBox but with touchinput override functions
Hiya, sorry for digging up this old thread, but Iâm now in UE5, would you mind sharing your solution if youâre still active?
Thx!
Hi! Could you please share a solution, please? I have been struggling with the same issue for over two weeksâŚ
Iâm back to this again, did you end up finding a solution? @SupportiveEntity @Everynone @pezzott1
Would you by chance know what @martoof meant here? âdone without ScrollBox but with touchinput override functionsâ Been stuck with this problem for a bit now
Thx for any help
~t
I was of the impression the scroll box selected, regardless of touch input or mouse input would take priority for the time being. As with focus on most others.
Maybe the user may be overriding the touch received for each of the widgets and manually processing the touch/drag logic?
Whatâs the use case? Just a scroll bar inside of another scroll bar?
Hmm, ok so yeah basically as you stated, I got it working in Unity a couple of years back as seen here, game prototype - YouTube the user can swipe vertically and horizontally. Mind you this wasnât a built-in solution, but Iâm sure UE5 can handle this
~t
The scrollbox has public methods to set scroll position. The difficulty here is the amount of use cases. When you focus a widget, the focused widget processes input and decides to bubble up input to a parent widget or not. This is called input handling. If you were to press the arrow keys, most likely they are consumed by the scroll box leaving you with nothing to work with. Havenât checked if there is default scroll button functionality. You can try this anyhow.
Create a UserWidget âScrollBoxControllerâ and make it hold the scrollbox, and the nested scrollbox inside that. Override the OnKeyDown method and test for a âdragâ button such as a middle mouse button. While the key is down, set the position of both the nested scroll boxes to their current scroll position + your mouse movement during tick.
Basically any widget you focus within such scroll box, or even the box itself if that is the only interactive thing, would bubble up input into the wrapping ScrollBoxContainer.
Thx Roy will try this, I should mention in my case this is for mobile just as a note. I wanted to post up where Iâm currently at in UE, as you will see the Vertical box takes precedence where itâs laid out.
And for some additional clarity I used this tutorial for the swipe controls
Thx for commenting!
~t
For what I described you need to make sure neither of the scroll boxes process the swipe as a scroll action, but the wrapping âScrollBoxControllerâ panel does. Iâd have to deep dive into code to tell you how itâs processed. You might be able to get the desired result with playing with the IsFocusable checkbox on the scrollboxes or overriding the input methods on a scrollbox subclass as well.
I agree with Roy here, my best recommendation would be to override the input methods on a scrollbox derived class and just process it manually. Otherwise you need to make a number of changes a bit deeper and thatâd be overkill for such basic mechanics.
Thx @Roy_Wierer.Seda145 @SupportiveEntity Is this something I could manage with BP? As Iâm not a âcoderâ in the traditional sense unfortunately
thx guys
~t
Yes it should be :).
Yep! Any blueprint (and most things with any form of event graph) can override their parentâs functions by going to this menu in their BP:
however if the parent is C++ this can get a bit more complicated as not all functions are exposed, but in your case that shouldnât be applicable.