swiftlys2/docs/api/ai/
API Reference › Menu.Components

SpacerComponent

Class
Namespace: SwiftlyS2.Shared.Menu.Components · Assembly: SwiftlyS2.CS2.dll
public class SpacerComponent : MenuComponentBase, IMenuComponent

Blank vertical space.

View source

Constructors

SpacerComponent(int, string?)

Creates a spacer.

public SpacerComponent(int lines = 1, string? id = null)
Parameters
  • linesintoptionalHow many blank lines to reserve. Values below one are treated as one.
  • idstring?optionalA stable id, or null to generate one.

Properties

LineCount

How many lines this component draws.

public override int LineCount { get; }
Property Value

Used to decide how much of the body fits on one page, without rendering components that will not be shown. It must match what IMenuComponentRenderContext) produces: a MenuBlankNode costs its Lines, a MenuStackNode costs the sum of its children, and everything else costs one. A component that returns a stack has to override this, otherwise it is budgeted as a single line and the page overflows.

Lines

How many blank lines this spacer reserves. Never less than one.

public int Lines { get; set; }
Property Value

Methods

Render(IMenuComponentRenderContext)

Produces this component's renderer-agnostic output.

public override MenuNode Render(IMenuComponentRenderContext context)
Parameters
Returns
The nodes describing this component.