I would like to add moving child nodes on a Sprite node, but want them to be clipped if they move outside the bounds, hence giving an impression of a 'window'. I know there is a UIView
property called clipsToBounds
that does the same. Is there a similar property for SKSpriteNode
, and if not, how to achieve the same?
You could add the sprite supposed to be clipped to a SKCropNode. Then set the crop node's maskNode
to a sprite node using an image that defines the crop region.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With