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

MenuTextStyle

Struct
Namespace: SwiftlyS2.Shared.Menu · Assembly: SwiftlyS2.CS2.dll
public readonly record struct MenuTextStyle : IEquatable<MenuTextStyle>

Renderer-agnostic presentation hints for a run of text.

These are hints, not commands. A renderer honours what its output medium supports and ignores the rest, which is what lets one component render on any renderer.

View source

Properties

Bold

Whether the text should be emphasised.

public bool Bold { get; init; }
Property Value

Color

The text colour as a hex string such as "#FFFFFF" , or null to inherit.

public string? Color { get; init; }
Property Value

Default

The default style: medium size, inherited colour, no emphasis.

public static MenuTextStyle Default { get; }
Property Value

Size

The relative text size.

public MenuTextSize Size { get; init; }
Property Value

Methods

WithColor(string?)

Returns a copy of this style with a different colour.

public MenuTextStyle WithColor(string? color)
Parameters
  • colorstring?The hex colour to apply, or null to inherit.
Returns
The adjusted style.

WithSize(MenuTextSize)

Returns a copy of this style with a different size.

public MenuTextStyle WithSize(MenuTextSize size)
Parameters
Returns
The adjusted style.