Skip to main content

DebugText

Internal debug text helper

Index

Constructors

constructor

Properties

publicreadonlyfontSheet

fontSheet: string = debugFont2

base64 font

publicsize

size: number = 16

Accessors

publicbackgroundColor

  • get backgroundColor(): Color

publicborderColor

publicforegroundColor

  • get foregroundColor(): Color

Methods

publicload

  • load(): Promise<void>
  • Returns Promise<void>

publicmeasureText

  • Measures the pixel dimensions of text as it would be drawn by DebugText.write, accounting for the optional scale factor.


    Parameters

    • text: string

      Text to measure

    • scale: number = 1

      Glyph scale factor, defaults to 1

    Returns BoundingBox

    BoundingBox whose width/height are the rendered size in pixels (origin Zero)

publicwrite

  • Writes debug text using the built in sprint font


    Parameters

    • ctx: ExcaliburGraphicsContext
    • text: string
    • pos: Vector
    • optionalforeground: Color

      Optional foreground color override

    • optionalbackground: Color

      Optional background color override

    • scale: number = 1

      Optional glyph scale factor, defaults to 1

    Returns void