API Docs for: v2.1.0
Show:

CGSGMaskClip Class

Extends CGSGMask parent class here
Module: Animation

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

CGSGMaskClip

(
  • clipRegion
)

Parameters:

Item Index

Methods

Methods

finalize

(
  • node
  • context
)
CanvasRenderingContext2D

Finalize this mask by adding to the saved context the image data corresponding to the mask region.

Parameters:

  • node CGSGNode

    the node

  • context CanvasRenderingContext2D

    the context returned by prepare()

Returns:

CanvasRenderingContext2D:

the context that was used to invoke prepare()

prepare

(
  • node
  • context
)
CanvasRenderingContext2D

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 CGSGNode

    the node

  • context CanvasRenderingContext2D

    the context where the region will be clipped

Returns:

CanvasRenderingContext2D:

the context to use