Grid
Introduction
Panels and Grids
var panel = new Panel();
panel.AddToRoot();
panel.Anchor(Gum.Wireframe.Anchor.Center);
panel.Height = 400;
panel.HeightUnits = Gum.DataTypes.DimensionUnitType.Absolute;
panel.Width = 400;
panel.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
var panelVisual = panel.Visual;
panelVisual.ChildrenLayout = Gum.Managers.ChildrenLayout.AutoGridHorizontal;
panelVisual.AutoGridHorizontalCells = 3;
panelVisual.AutoGridVerticalCells = 3;
for(int i = 0; i < 9; i++)
{
var button = new Button();
panel.AddChild(button);
button.Text = $"Button {i}";
}
Grid Cells as Parents

Grid Overflow


Grid Sized to Children

Last updated
Was this helpful?

