Flip/Mirror tips

1 reply [Last post]
Chman
User offline. Last seen 34 weeks 1 day ago. Offline
Joined: 28 Jan 2010

This is a basic trick, but I can't find any reference of it in the doc, so...
If you want to flip and/or mirror a display object, scale it negatively :

1
2
3
local img = display.newImage("image.png", 0, 0);
img:scale(-1, 1); -- Mirror
img:scale(1, -1); -- Flip

Might be useful to beginners :)

Tom

Replies

afyzendo
User offline. Last seen 1 year 17 weeks ago. Offline
Joined: 9 Feb 2010

Cool trick, Tim. Thanks!
Arjan

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.