Renderer2D

Renderer2D

Renders images and paths to the 2D context of a canvas.

Constructor

new Renderer2D(canvasopt)

Source:
Parameters:
Name Type Attributes Description
canvas HTMLCanvasElement <optional>
element to draw on

Extends

Classes

Renderer2D

Members

camera :Camera2D

Source:
Overrides:
Type:

ctx :CanvasRenderingContext2D

Source:
Type:
  • CanvasRenderingContext2D

domElement :HTMLCanvasElement

Source:
Overrides:
Type:
  • HTMLCanvasElement

height :number

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

width :number

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

Methods

bindTo(selector, focus)

Source:
Deprecated:
  • Yes
Parameters:
Name Type Default Description
selector string
focus boolean true

clear()

Source:
Deprecated:
  • Yes

setViewport(x, y)

Source:
Deprecated:
  • Yes
Parameters:
Name Type Description
x number
y number

(static) clear(renderer)

Source:
Parameters:
Name Type Description
renderer Renderer2D

(static) render(ctx, position, orientation, scale, sprite, dt)

Source:
Parameters:
Name Type Description
ctx CanvasRenderingContext2D
position Vector2
orientation number
scale Vector2
sprite Sprite.<T, U>
dt number