Layout#

class Layout#

Arranges the elements of a panel automatically, so that they do not have to be positioned one by one. See Panel.AddHorizontalLayout, Panel.AddVerticalLayout and Panel.AddGridLayout.

float Spacing { get; set; }#

The gap left between the elements, in pixels. A grid layout uses it in both directions.

Game Scenes:

All

Padding Padding { get; set; }#

The gap left inside the edges of the panel.

Game Scenes:

All

TextAnchor ChildAlignment { get; set; }#

Where the elements are placed within the space the layout has to fill.

Game Scenes:

All

Tuple<double, double> CellSize { get; set; }#

The size of each cell of a grid layout, in pixels.

Game Scenes:

All

Note

Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements.

GridConstraint Constraint { get; set; }#

What fixes the shape of a grid layout.

Game Scenes:

All

Note

Only applies to a grid layout. Throws an exception for the other layouts.

int ConstraintCount { get; set; }#

The number of columns or rows that Layout.Constraint fixes, ignored when the constraint is GridConstraint.Flexible.

Game Scenes:

All

Note

Only applies to a grid layout. Throws an exception for the other layouts.

struct Padding#

The gap left inside each edge of a layout, in whole pixels.

Note

See Layout.Padding.

Padding (int left, int right, int top, int bottom)#

Construct a Padding from the values of its fields.

int Left { get; }#

The gap inside the left edge.

int Right { get; }#

The gap inside the right edge.

int Top { get; }#

The gap inside the top edge.

int Bottom { get; }#

The gap inside the bottom edge.

enum GridConstraint#

What fixes the shape of a grid layout.

Flexible#

Fit as many columns and rows as the size of the panel allows.

FixedColumnCount#

Use a fixed number of columns, and as many rows as are needed.

FixedRowCount#

Use a fixed number of rows, and as many columns as are needed.