API Docs for: 1.4.3
Show:

CanvasRenderer Class

the CanvasRenderer draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. Dont forget to add the view to your DOM or you will not see anything :)

Constructor

CanvasRenderer

(
  • width=0
  • height=0
  • view
  • transparent=false
)

Parameters:

  • width=0 Number

    the width of the canvas view

  • height=0 Number

    the height of the canvas view

  • view Canvas

    the canvas to use as a view, optional

  • transparent=false Boolean

    the transparency of the render view, default false

Methods

render

(
  • stage
)

Renders the stage to its canvas view

Parameters:

  • stage Stage

    the Stage element to be rendered

renderDisplayObject

(
  • displayObject
)
private

Renders a display object

Parameters:

renderStrip

(
  • strip
)
private

Renders a strip

Parameters:

  • strip Strip

    The Strip to render

renderStripFlat

(
  • strip
)
private

Renders a flat strip

Parameters:

  • strip Strip

    The Strip to render

resize

(
  • width
  • height
)

resizes the canvas view to the specified width and height

Parameters:

  • width Number

    the new width of the canvas view

  • height Number

    the new height of the canvas view

Properties

context

Canvas 2d Context

The canvas context that the everything is drawn to

height

Number

The height of the canvas view

Default: 600

view

Canvas

The canvas element that the everything is drawn to

width

Number

The width of the canvas view

Default: 800