Why SKShapeNode does not have anchor point? [closed]
Asked Answered
L

1

17

i am trying to understand why SKShapeNode does not have an anchor point ?

Legit answered 21/12, 2013 at 16:59 Comment(0)
C
19

When you use an image you may need to align it on its node's position. There's no other way to do so but through anchorPoint because the image itself can't be modified (not easily anyway).

When you create a shape you have full control over the alignment of the shape through CGPath. You can simply translate the path to change the shape's alignment relative to the node's position.

This is my interpretation, not fact.

Colorant answered 21/12, 2013 at 19:0 Comment(2)
Can you post some sample code of how a rotation action can be attached to an SKShapeNode in a way that the shape rotates by its center?Yuletide
How is this done? Can someone post a code example?Amorous

© 2022 - 2024 — McMap. All rights reserved.