I need to organize my UI:
a checkbox on top left, the description on the right next to it
2 texts under
a button at the bottom
few texts over from left to right.
So I had the idea of creating UIElements:
a top canvas on top left, layoutmode vertical
a bottom canvas, at bottom of the screen, layout mode vertical
etc
If I add the checkbox to the UI.Root it works, but if I add it to the topCanvas UIElement, it does not work anymore…
C# code:
private void CreateUI()
{
var topCanvas = new UIElement();
topCanvas.LayoutMode = LayoutMode.Vertical;
topCanvas.VerticalAlignment = VerticalAlignment.Top;
topCanvas.HorizontalAlignment = HorizontalAlignment.Left;
topCanvas.Name = "topCanvas";
//topCanvas.SetStyleAuto(null);
UI.Root.AddChild(topCanvas);
showNamesCheckbox = new Urho.Gui.CheckBox();
showNamesCheckbox.Name = "CheckBoxNames";
showNamesCheckbox.Checked = true;
showNamesCheckbox.VerticalAlignment = VerticalAlignment.Bottom;
showNamesCheckbox.HorizontalAlignment = HorizontalAlignment.Right;
showNamesCheckbox.SetDefaultStyle(style);
showNamesCheckbox.SetColor(Urho.Color.Cyan);
topCanvas.AddChild(showNamesCheckbox);
}