CGSGMaskClip Class
This class clips a region of a given node (including its children) according to a specified dimension. Internally, a fake context is created and then desired data are retrieved from it and drawn to the original context.
Constructor
Methods
finalize
(
CanvasRenderingContext2D
-
node
-
context
Finalize this mask by adding to the saved context the image data corresponding to the mask region.
Parameters:
-
node
CGSGNodethe node
-
context
CanvasRenderingContext2Dthe context returned by prepare()
Returns:
CanvasRenderingContext2D:
the context that was used to invoke prepare()
prepare
(
CanvasRenderingContext2D
-
node
-
context
Prepare the rendering of the node by saving the given context and returning a temporary context where the node and its children should rendered.
Parameters:
-
node
CGSGNodethe node
-
context
CanvasRenderingContext2Dthe context where the region will be clipped
Returns:
CanvasRenderingContext2D:
the context to use