2

Is there a way to create a SKSpriteNode and pass it an image name, but have it reflect the image horizontally?

Alex Stone
  • 44,280
  • 53
  • 219
  • 394

1 Answers1

4

You mean you want to flip the image?

node.xScale = node.xScale * -1;

or

node.yScale = node.yScale * -1;
Kazuki Sakamoto
  • 13,904
  • 2
  • 33
  • 95
  • 1
    xScale flips the node and all of its children. This works for simple sprites, but if the sprite has children, I need to reflect the image only, not everything. – Alex Stone Jan 17 '14 at 18:12
  • 1
    Separate the image from the node. Thus create a SKNode and append a SKSpriteNode with the image. Append the children to the SKNode. – Kazuki Sakamoto Jan 17 '14 at 18:57