Topic was automatically imported from the old Question2Answer platform.
Asked By
CKO
I want to create a panel that horizontally centers the buttons within it. If the screen width is not enough for all the buttons, then the panel should be horizontally scrollable
The ScrollContainer has a full rect layout and the HBoxContainer center layout
This is not working, however. The buttons end up on the left side of the screen even though they are centered in the editor.
What am I doing wrong here?
Basically, I want the buttons to be horizontally centered and if there are too many buttons to fit on the screen horizontally, then the user should be able to scroll horizontally to view the off-screen buttons
Thanks for the response, TyTYctA, but when there are few buttons (one or two, for example) then the buttons are not centered horizontally… they appear on the left side. Basically, I want the buttons to be horizontally centered on the screen and if there are too many buttons to fit on the screen horizontally, then the user should be able to scroll horizontally to view the off-screen buttons
CKO | 2019-03-06 08:07
you need enable Horizontal expand option of size Flags of HBoxContainer for centering in ScrollContainer