Type Alias BpxArrangedGlyph

BpxArrangedGlyph: {
    char: string;
    leftTop: BpxVector2d;
    lineNumber: number;
    sprite: BpxSprite;
    spriteColorMapping: BpxSpriteColorMapping;
    type: "sprite";
} | {
    char: string;
    color: BpxRgbColor;
    leftTop: BpxVector2d;
    lineNumber: number;
    pixels: BpxPixels;
    type: "pixels";
} | {
    lineNumber: number;
    type: "line_break";
}

Similar to BpxGlyph, but after being arranged by BpxFont.arrangeGlyphsFor in context of given glyphs' placement, text color, and color markers.

Used by BeetPxDraw.measureText for a headless text rendering. Also, used by BeetPxDraw.text for an actual text rendering.

Type declaration

  • char: string
  • leftTop: BpxVector2d

    Left-top position of a glyph in relation to the left-top of the entire text.

  • lineNumber: number

    Line number within the entire text (multiple lines can be achieved by including \n within the text).

  • sprite: BpxSprite
  • spriteColorMapping: BpxSpriteColorMapping

    The color mapping used to draw a glyph's sprite in a desired text color.

  • type: "sprite"

Type declaration

  • char: string
  • color: BpxRgbColor
  • leftTop: BpxVector2d

    Left-top position of a glyph in relation to the left-top of the entire text.

  • lineNumber: number

    Line number within the entire text (multiple lines can be achieved by including \n within the text).

  • pixels: BpxPixels
  • type: "pixels"

Type declaration

  • lineNumber: number

    Line number within the entire text (multiple lines can be achieved by including \n within the text).

  • type: "line_break"