Hierarchy

  • ExcaliburGraphicsContextWebGL

Implements

Constructors

Properties

__gl: WebGL2RenderingContext

Meant for internal use only. Access the internal context at your own risk and no guarantees this will exist in the future.

backgroundColor: Color = Color.ExcaliburBlue

Set the background color of the graphics context, default is [[Color.ExcaliburBlue]]

debug: ExcaliburGraphicsContextWebGLDebug = ...

Access the debug drawing api

smoothing: boolean = false

Enable smoothed drawing (also known as anti-aliasing), by default false

snapToPixel: boolean = false

Snaps all drawings to the nearest pixel truncated down, by default false

textureLoader: TextureLoader
useDrawSorting: boolean = true

Excalibur will automatically sort draw calls by z and priority for maximal draw performance, this can disrupt a specific desired painter order.

To force a specific draw call order, use [[ExcaliburGraphicsContext.z]]

By default useDrawSorting is true, to opt out set this to false

Accessors

  • get z(): number
  • Set the current z context for the graphics context. Draw calls issued to the context will use this z to inform their sort order.

    Note it is important to all [[ExcaliburGraphicsContext.save]] and [[ExcaliburGraphicsContext.restore]] when modifying state.

    Returns number

  • set z(value): void
  • Set the current z context for the graphics context. Draw calls issued to the context will use this z to inform their sort order.

    Note it is important to all [[ExcaliburGraphicsContext.save]] and [[ExcaliburGraphicsContext.restore]] when modifying state.

    Parameters

    • value: number

    Returns void

Methods