Stack panel horizontal alignment

Hello
The horizontal alignment is not working.
I tryed at the playground to be sure.

var panel = new BABYLON.GUI.StackPanel();
advancedTexture.addControl(panel);
panel.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_BOTTOM;
panel.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;

Hey and welcome!

do you mind creating a repro on the PG?

panel.width is probably just 100%

Excact code that iā€™m using.

https://www.babylonjs-playground.com/#XCPP9Y#1541

@JFerret as suspected :slight_smile:

Solution 1; - Adapt to children width

chatStack.adaptWidthToChildren = true;
https://www.babylonjs-playground.com/#XCPP9Y#1543

Solution 2; - Hard-code same width as children

chatStack.width = ā€œ400pxā€;
https://www.babylonjs-playground.com/#XCPP9Y#1544

1 Like

My apologies, iā€™m new to Babylon and java script :smiley:

Thank you for the solution, it works like i wanted!