1

Just ask the title asks, I am wondering if this is at all possible. Most examples of the SKCropNode use a texture or a shape. What I want to accomplish is a mask of a custom shape. Let me know if there's a way!

Lyres
  • 343
  • 4
  • 14

1 Answers1

0

You could mask a node by giving it a child node where the child node's zPosition is greater than the parent's. And then, of course, you'd have to position the child node correctly on top of the parent node -but this should be easy as the child node's position is located relative to the parent node (i.e. if parent has position (25, 30) in the scene, and you set child.position = CGPoint(x:5, y:0), the child's position in the scene would be (30, 30)). Also, if the parent node moves, the child node moves with it.

Ralph
  • 471
  • 5
  • 14
  • This is not a mask, this is an overlay. Masks in this case is data used for bitwise operations. E.G. SKCropNodes, any pixel with alpha < 0.5 in a mask is cropped on the given node – Knight0fDragon Oct 30 '16 at 07:50
  • Yes I wish to use a mask using the SKCropNode, not placing a node on top of another. – Lyres Oct 30 '16 at 19:52