Sprite Kit equivalent clips

I would like to add moving child nodes to the Sprite node, but I want them to be cropped if they move outside, which gives the impression of a β€œwindow”. I know that there is a UIView property called clipsToBounds that does the same thing. Is there a similar property for SKSpriteNode , and if not, how to achieve the same?

+6
source share
1 answer

You can add a sprite that should be attached to SKCropNode . Then set the clipping node maskNode to the sprite node using an image that defines the clipping region.

+8
source

All Articles