0 votes

Hi,

I'm trying to build a scrolling bar the contains different sized buttons:

enter image description here

As you can see, if I use the separation attribute of HBoxContainer, the buttons are evenly spaced, creating irregular gaps between each other.

I have tried all sorts of combination of Size Flags and Stretch Ratio. I haven't been able to:

1) get the buttons to space according to their size (with a small margin between each) and
2) keep the box scrollable.

The HBoxContainer is placed inside a ScrollContainer and each button is subsequently added as a child of the HBoxContainer in the scripts.

At this point any help would be welcome!

Thanks

in Engine by (22 points)

1 Answer

0 votes

Not sure if anyone has or will see this but essentially, the gist of the problem is that I can't seem to align all buttons to the left. For some reason, they are being spaced out equally as per their left side, essentially creating a gap. What I want is for them to all be crammed to the left side, much like with display: flex in CSS.

by (22 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories