Quick Links: Download Gideros Studio | Gideros Documentation | Ultimate Guide | Gideros Development Center
Sprites: reverse image? - Gideros Forum

Sprites: reverse image?

snooks Member
edited August 5 in Game & application design
Apologies for seemingly daft question, but I've searched for an answer to this and can't find anything obvious in the API docs. At the moment I have a sprite sheet that does stuff going in a right hand direction. How do I flip the sprite for going left?

Comments

  • mertocanmertocan Member
    Accepted Answer
    you can use sprite:setScaleX( sprite:getScaleX()*-1) to flip vertical or you can use sprite:setScaleY( sprite:getScaleY()*-1) to flip horizontally. However, you should be careful when positioning because anchorpoint will flip aswell.
    +1 -1
  • snooks Member
    Ahhh, okay... thanks very much!
    +1 -1
  • antixantix Member
    So using setAnchorPoint (0.5, 0.5) is good in this situation also as the sprite will flip on its midpoint, not its edge.

    Aye: snooks

    +1 -1 (+1 / -0 )
Sign In or Register to comment.