RSX Code Reference
    Preparing search index...
    • rsx
    • UIDrawContent

    Class UIDrawContent

    Encapsulates all drawable elements (paths, text, images) used for UI rendering. Elements are stored in insertion order to maintain proper z-ordering during rendering.

    This class is passed to GenerateDrawContent() with pre-baked context (bounds, dpiScale).

    Index
    • Parameters

      • OptionalisInternalConstructor: boolean

      Returns UIDrawContent

    • get dpiScale(): number

      The DPI scale factor. Set by the owning element for convenience.

      Returns number

    • set dpiScale(value: number): void

      Parameters

      • value: number

      Returns void

    • Adds a path to this draw content.

      Parameters

      • path: Path

        The path to add.

      • Optionaldepth: number

        The depth layer for this path (higher = rendered on top).

      Returns void

    • Adds a text element with common parameters (left/top aligned).

      Parameters

      • text: string

        The text string to display.

      • position: Immutable<Vector2>

        Position in points (local coordinates).

      • Optionalfont: Font

        The font to use (nullptr for default).

      • OptionalfontSize: number

        Font size in points.

      • Optionalcolor: Immutable<SRGBColor>

        Text color.

      • Optionaldepth: number

      Returns void

    • Adds a centered text element at the specified position.

      Parameters

      • text: string

        The text string to display.

      • position: Immutable<Vector2>

        Center position in points (local coordinates).

      • Optionalfont: Font

        The font to use (nullptr for default).

      • OptionalfontSize: number

        Font size in points.

      • Optionalcolor: Immutable<SRGBColor>

        Text color.

      • Optionaldepth: number

      Returns void

    • Clears all elements and resets the content for reuse.

      Returns void

    • Calculates the size of text in points.

      Parameters

      • text: string

        The text string to measure.

      • font: Font

        The font to use for measurement.

      • fontSize: number

        Font size in points.

      • dpiScale: number

        DPI scale factor for point-to-pixel conversion.

      • OptionalmaximumWidth: number

        Optional maximum width in points for word wrapping.

      Returns Size2

      The size of the text in points.