Skip to main content

DebugDraw

Index

Methods

drawCircle

  • drawCircle(pos: Vector, radius: number, color: Color, stroke?: Color, thickness?: number): void
  • Draw a circle to the Excalibur Graphics context


    Parameters

    • pos: Vector
    • radius: number
    • color: Color
    • optionalstroke: Color

      Optionally specify the stroke color

    • optionalthickness: number

    Returns void

drawLine

drawPoint

drawRect

  • drawRect(x: number, y: number, width: number, height: number, rectOptions?: RectGraphicsOptions): void
  • Draw a debugging rectangle to the screen


    Parameters

    Returns void

drawText

measureText

  • measureText(text: string, scale?: number): { height: number; width: number }
  • Measure the pixel dimensions of debug text as it would be drawn by DebugDraw.drawText, accounting for the optional scale factor. Useful for sizing UI around debug labels.


    Parameters

    • text: string

      Text to measure

    • optionalscale: number

      Glyph scale factor, defaults to 1

    Returns { height: number; width: number }

    • height: number
    • width: number