Class

SKCropNode

A node that masks pixels drawn by its children so that only some pixels are seen.

Declaration

@interface SKCropNode : SKNode

Overview

SKCropNode is a container node that you use to crop other nodes in the scene. You add other nodes to a crop node and set the crop node's maskNode property. For example, here are some ways you might specify a mask:

  • An untextured sprite that limits content to a rectangular portion of the scene.

  • A textured sprite that works as a precise per-pixel mask.

  • A collection of child nodes that form a unique shape.

You can animate the shape or contents of the mask to implement interesting effects such as hiding or revealing.

Topics

First Steps

Crop other nodes in the scene by adding them as child nodes to a crop node.

Cropping Nodes

Use a texture or a shape to mask pixels out of a crop node's children.

Setting the Mask Filter

maskNode

The node used to determine the crop node’s mask.

Relationships

Inherits From

See Also

Nodes that Modify Drawing

SKEffectNode

A node that renders its children into a separate buffer, optionally applying an effect, before drawing the final result.

SKTransformNode

A node that allows its children to rotate in 3D.