Renderer

Renderer

This is an abstract class from which different types of renderers are implemented.

Constructor

(abstract) new Renderer(canvas)

Source:
See:
Parameters:
Name Type Description
canvas HTMLCanvasElement element to draw on

Classes

Renderer

Members

camera :Camera2D

Source:
Type:

domElement :HTMLCanvasElement

Source:
Type:
  • HTMLCanvasElement

height :number

Description:
  • Height of the renderer
Source:
Height of the renderer
Type:
  • number

width :number

Description:
  • Width of the renderer
Source:
Width of the renderer
Type:
  • number

Methods

(static) bindTo(selector, focus, renderer)

Description:
  • Attaches the renderer to a given html element by its selector.
Source:
Parameters:
Name Type Default Description
selector string A css selector string that is passed to document.querySelector
focus boolean true whether to shift focus of input to the element pr not
renderer Renderer

(static) requestFullScreen(renderer)

Description:
  • Requests fullscreen for the renderer.
Source:
Parameters:
Name Type Description
renderer Renderer

(static) setViewport(w, h, renderer)

Description:
  • Sets the width and height of the canvas being rendered to.
Source:
Parameters:
Name Type Description
w number Width of the canvas.
h number Height of the canvas.
renderer Renderer