I have a scene 224 pixels wide and I'm trying to code a simple UI rather than using the visual editor.
I'm trying to get a hboxcontainer to expand to the full width of the screen and hold two labels. I'm trying to get one label left aligned and the other right aligned to the far right of the container. I can get this to work perfectly in the editor but not in code.
var hbox = HBoxContainer.new()
var label_left = Label.new()
var label_right = Label.new()
I feel that I'm not managing to get the container to match the layout selection which I can use in the editor which is the either the TOP WIDE or FULL RECT option.
Here's how it looks when I design it in the editor:
Here's how it looks when I attempt the code:
Hoping someone has done this type of thing in code before and can advise me how to do this. Thanks for any help.