The qc.NodeMask component is used to clip node's children.

nodeMask = node.addScript('qc.NodeMask');

Clip Mode

  1. Rectangle: Only the content inside the node's bounds will be displayed.

    nodeMask.mode = qc.NodeMask.MODE_DEFAULT;
  2. Pixel: Use a texture for mask, only the content inside the opaque area of the texture will be displayed.

    nodeMask.mode = qc.NodeMask.MODE_PIXEL;
Rectangle Pixel(Circle)

Pixel Sample

  1. Create two UIImage object, one as parent 'QICI', another one as child 'Sun'
  2. Add "UI/NodeMask" component on the parent node
  3. Set the "Clip Mode" as "Pixel" in Inspepctor panel