CanvasMaskManager Class
A set of functions used to handle masking
Item Index
Methods
Methods
CanvasBuffer
-
width
-
height
Creates a Canvas element of the given size.
Parameters:
-
width
Numberthe width for the newly created canvas
-
height
Numberthe height for the newly created canvas
clear
()
private
Clears the canvas that was created by the CanvasBuffer class.
popMask
-
renderSession
Restores the current drawing context to the state it was before the mask was applied.
Parameters:
-
renderSession
ObjectThe renderSession whose context will be used for this mask manager.
pushMask
-
maskData
-
renderSession
This method adds it to the current stack of masks.
Parameters:
-
maskData
Objectthe maskData that will be pushed
-
renderSession
ObjectThe renderSession whose context will be used for this mask manager.
resize
-
width
-
height
Resizes the canvas to the specified width and height.
Parameters:
-
width
Numberthe new width of the canvas
-
height
Numberthe new height of the canvas
Properties
canvas
HTMLCanvasElement
The Canvas object that belongs to this CanvasBuffer.
context
CanvasRenderingContext2D
A CanvasRenderingContext2D object representing a two-dimensional rendering context.
height
Number
The height of the Canvas in pixels.
width
Number
The width of the Canvas in pixels.