API Reference
Class
Align
Places a child at its measured size inside a larger region: left, centre or right, and top, middle or bottom. Horizontally aligned content claims the full offered width so it can be centred or pushed right; vertical alignment applies when the parent gives the child more rows than it measured (a fixed height or a fill share). Children that already measure to the full width, such as progress bars, are unaffected horizontally.
Inheritance
- Object
- Align
Constructors
public Align(IWidget child, HorizontalAlignment horizontal = Center, VerticalAlignment vertical = Top) #Creates an alignment wrapper.
Parameters
- child ConsoleMonster.Layout.IWidget
- The child.
- horizontal ConsoleMonster.Layout.HorizontalAlignment = Center
- Horizontal placement (default centre).
- vertical ConsoleMonster.Layout.VerticalAlignment = Top
- Vertical placement (default top).
Methods
public Size Measure(Constraints constraints, RenderContext context) #Returns:
SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Void Render(Region region, RenderContext context) #Returns:
VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?