Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Tentamens |
Hi there!
I’m trying to use the Scroll Container but it doesn’t seem to be detected that there are things inside of it (it’s not making the scroll bar on the side) I’m using button’s inside a Vbox maybe that’s why but I can’t seem to figure it out.
my scene tree :
Big thanks for the help!
It could be the child’s size ~ in this case the VBox container ~ double check the orange rectangle is wrapping all the children and that the size-flags and layout is set correctly
Ha-kuro | 2022-08-06 19:04
Hey there! thanks for the response,
But I’m confused about what you mean by the child’s size is off but here is my scene I’m trying to get to work - Imgur: The magic of the Internet
Tentamens | 2022-08-06 20:27
Ah thanks for the video, easier to see what’s happening.
Making UI in Godot can be tricky so it could be a number of things, but I’ll list a couple potential solutions:
- The ScrollContainer needs to be smaller than its children, so make the ScrollContainer the size you want it and then let the children (e.g. VBoxContainer) be larger than the ScrollContainer
- Using Layout can help when dealing with UI, you can make the container
Full Rect
layout to make its max height and width the same as the viewport
Lmk how you go
Ha-kuro | 2022-08-07 17:16
Came across a similar issue that I was able to solve. In my case, even though I was adding a ton of content to my HBox (that was inside a scroll container and without clipping enabled), the size reported in Remote (debugger) was the same size as the gridcontainer which is unexpected. The HBox should have been way bigger. I ended up having to measure the width of all children in my HBox and then set the HBox min_size to the combined total. For me, I did this on resize but it could be done on add or wherever.
To see if this is your issue, look at remote and compare your gridcontainer dimensions with it’s top control node dimensions. If they are the same, this is likely the problem.
GrayDwarf | 2022-10-25 14:33