GUI button alignment?

Hello!

I try to align buttons left and right on StackPanel() but cannot make them work

what i do wrong?

The only way in a StackPanel is to give space between buttons. You can’t do it with the button itself.

use panel.spacing = 760; After the value I guess you can with javascript set it in relation to the width of the screen.

Otherwise don’t use a StackPanel and it will work :slight_smile:

Or use a Rectangle instead of StackPanel.

this what i want to do

but i got some errors

BJS - [14:46:55]: Control (Name:title, UniqueId:288) is using width in percentage mode inside a horizontal StackPanel :smirking_face:

adding an ignoreLayoutWarnings to your stackpanel will remove its errors from the console :

mainpanel.ignoreLayoutWarnings = true;

1 Like