I’m trying to create a responsive scrollbar for mobile, my idea is that the scrollbar behaves like the blue box, does anyone know how to do it?
I leave a link to the project
https://playcanvas.com/editor/scene/1374562
Hmm, actually if you reparent your scroll view to your blue box entity (add it as a child to it), it works as expected.
It gets the dimensions and behavior of it.
Maybe try replicating the settings from that element to another parent element for the scrollview?
if you can do exactly that, the problem is that the scroll loses the mask and doesn’t let me handle it the same way.
it wasn’t that easy but I managed to fix it thanks to your advice, thank you very much leonidas for your help.
Nice! Can you share the final setup if you like, it maybe useful to others coming to this thread.
perfect I will leave the project open so anyone who needs it can copy and paste what they need, thank you very much again leonidas
I am trying to create a responsive scrollbar for mobile and I have a problem with the responsive of the elements inside the elements, these elements disappear when the screen is small.
Does anyone know why this happens?
I leave video and link of the project
https://playcanvas.com/editor/scene/1374562
Hi @isvaku ,
Your best bet would be to adjust the pivots and anchors of the items that need to remain in the same place relative to their parents. Here’s part of the user manual that goes in depth with these concepts:
https://developer.playcanvas.com/en/user-manual/user-interface/elements/
Basically, you will want to anchor your scrollbar to one edge of its parent element, and adjust it’s pivot (likely to the left) so that it is always visible regardless of screen size.
I hope this is helpful.
thanks for your answer eproasim, I know how the anchors and the pibotes work, the problem is that you lose control of them when you are inside a scroll or I don’t know if it is because of the mask exactly, in any case even if the anchors are ok it still doesn’t work.