Options
All
  • Public
  • Public/Protected
  • All
Menu

Recursive rendering utilizing HTML5 canvas.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new CanvasRenderer(width: number, height: number, container: HTMLElement): CanvasRenderer

Properties

Protected canvas

canvas: HTMLCanvasElement

Canvas element for rendering.

Protected container

container: HTMLElement

Containing element for the canvas.

Protected height

height: number

Height of the canvas in pixels.

Protected width

width: number

Width of the canvas in pixels.

Accessors

canvasElement

  • get canvasElement(): HTMLCanvasElement

Methods

Protected isInCamera

  • isInCamera(entity: Sprite, camera: any): boolean
  • Determines if the provided entity is visible to the camera.

    Parameters

    • entity: Sprite

      Sprite to check for visibility.

    • camera: any

      Camera to use when determining visibility.

    Returns boolean

render

  • render(container: Container, clear?: boolean): void
  • Recursive method for rendering the provided container and all its children.

    Parameters

    • container: Container

      Container object to render recursively.

    • Default value clear: boolean = true

      Whether or not to clear the canvas before rendering.

    Returns void