Skip to main content

Text

Represent Text graphics in excalibur

Useful for in game labels, ui, or overlays

Hierarchy

Index

Constructors

constructor

Properties

publicoptionalcolor

color?: Color

readonlyid

id: number = ...

publicoptionalmaxWidth

maxWidth?: number

publicopacity

opacity: number = 1

Gets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).

publicshowDebug

showDebug: boolean = false

Gets or sets wether to show debug information about the graphic

publictint

tint: Color = null

publictransform

transform: AffineMatrix = ...

Accessors

publicflipHorizontal

  • get flipHorizontal(): boolean
  • set flipHorizontal(value: boolean): void
  • Gets or sets the flipHorizontal, which will flip the graphic horizontally (across the y axis)


    Returns boolean

  • Parameters

    • value: boolean

    Returns void

publicflipVertical

  • get flipVertical(): boolean
  • set flipVertical(value: boolean): void
  • Gets or sets the flipVertical, which will flip the graphic vertically (across the x axis)


    Returns boolean

  • Parameters

    • value: boolean

    Returns void

publicfont

publicheight

  • get height(): number
  • Gets or sets the height of the graphic (always positive)


    Returns number

publiclocalBounds

  • Gets a copy of the bounds in pixels occupied by the graphic on the the screen. This includes scale.


    Returns BoundingBox

publicorigin

  • Gets or sets the origin of the graphic, if not set the center of the graphic is the origin


    Returns Vector

  • Parameters

    Returns void

publicrotation

  • get rotation(): number
  • set rotation(value: number): void
  • Gets or sets the rotation of the graphic


    Returns number

  • Parameters

    • value: number

    Returns void

publicscale

  • Gets or sets the scale of the graphic, this affects the width and


    Returns Vector

  • Parameters

    Returns void

publictext

  • get text(): string
  • set text(value: string): void
  • Returns string

  • Parameters

    • value: string

    Returns void

publicwidth

  • get width(): number
  • Gets or sets the width of the graphic (always positive)


    Returns number

Methods

publicclone

  • Returns a new instance of the graphic that has the same properties


    Returns Text

publiccloneGraphicOptions

publicdraw

  • Draw the whole graphic to the context including transform


    Parameters

    Returns void

publicisStale

  • isStale(): boolean
  • Returns boolean