CGSGMask Class
Utility class which represents a mask to apply on several nodes. The class should be sub-classed to define particular rendering. This class actually does not any rendering. However, when its 'apply' method is called, it begins to observe the given node and calls rendering methods which should be overridden.
Two key methods are provided here :
- prepare which is called before the node and its children is rendered
- finalize which is called once the rendering of the node has been done
Constructor
CGSGMask
()
Item Index
Methods
_eventAdapter
(
private
-
event
Observer method which catches key events to apply the mask.
Parameters:
-
event
CGSGEventthe event
_internalApply
(
private
-
node
Override this method to perform custom additional stuff when applying this mask.
Parameters:
-
node
CGSGNodethe node
_internalRemove
(
private
-
node
Override this method to perform custom additional stuff when removing this mask.
Parameters:
-
node
CGSGNodethe node
finalize
(
-
node
-
context
Method to override to finish the mask rendering.
Parameters:
-
node
CGSGNodethe observed node
-
context
CanvasRenderingContext2Dthe context
prepare
(
-
node
-
context
Method to override to prepare the given context to render.
Parameters:
-
node
CGSGNodethe observed node
-
context
CanvasRenderingContext2Dthe context