Quick Links: Gideros Home | Download Gideros | Developer Guide
Sprites: reverse image?
  • snooks +1 -1
    Member
    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?
  • mertocanmertocan +1 -1
    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.
  • snooks +1 -1
    Member
    Ahhh, okay... thanks very much!
  • antixantix +1 -1 (+1 / -0 )
    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.

    Likes: snooks

    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

In this Discussion

Top Posters