Options
All
  • Public
  • Public/Protected
  • All
Menu

Abstract class to extend for specific renderers.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Renderer(width: number, height: number, container: HTMLElement): Renderer
  • Abstract class, so not to be called directly.

    Parameters

    • width: number
    • height: number
    • container: HTMLElement

    Returns Renderer

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

Abstract render

  • render(container: Container, clear?: boolean): void