2

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

Alex Stone
  • 46,408
  • 55
  • 231
  • 407

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,929
  • 2
  • 34
  • 96
  • 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