Viewport for multiple buttons, ...?


#1

Guys, sorry if this is a stupid question, but after reading a lot of the docs, I couldn´t find what I was looking for. The idea is to have multiple things in a window with a scroll-bar to go up and down, since the number of items is too big for the whole window. I see that the Viewport does that for a single item, but not for multiple items. So, do I need to manually take care of this, or is there another way? I would manually replace things on the screen according to the resize + scroll-bar position, but I wonder if that´s “smart”… :wink:

Thanks! :mrgreen:

Best Regards, WilliamK


#2

Create a container component, put your buttons on that - put the container component on the Viewport

Rail


#3

Ach, that´s perfect, thank you so much! I´m glad I asked, before spending hours and hours for nothing. :oops: Thanks again.

Best Regards, WilliamK


#4

William, did you go anywhere with the other approach? It occurs to me that a ‘virtual viewport’ might be useful in that you get better control of how each component gets to its new position (for instance a staggered animation).

Bruce


#5

The idea is to create a custom object and use the viewport, I hope that´s all it takes. :wink:


#6

Yes, viewports are supper easy. it doesn’t even need to be a custom component, as I recall. A generic ‘Component’ works.

But I was thinking more about your approach of manually tracking objects, the idea being that they would get a new position from scrolling, but would be responsible for their own position (or there parent would, I suppose). That way, it doesn’t have to be a vanilla scroll.

Bruce