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
Numberthe width of the canvas view
-
height=0
Numberthe height of the canvas view
-
view
Canvasthe canvas to use as a view, optional
-
transparent=false
Booleanthe transparency of the render view, default false
Item Index
Methods
render
-
stage
Renders the stage to its canvas view
Parameters:
-
stage
Stagethe Stage element to be rendered
renderDisplayObject
-
displayObject
Renders a display object
Parameters:
-
displayObject
DisplayObjectThe displayObject to render
renderStrip
-
strip
Renders a strip
Parameters:
-
strip
StripThe Strip to render
renderStripFlat
-
strip
Renders a flat strip
Parameters:
-
strip
StripThe Strip to render
resize
-
width
-
height
resizes the canvas view to the specified width and height
Parameters:
-
width
Numberthe new width of the canvas view
-
height
Numberthe 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