How to do a "flip" transition?

Hi,

I have seen an effect in a few apps that I would like to include in one of my apps, but I have no idea where to start…

The effect is like flipping the screen, rotating it as if it were fixed at two points (top and bottom) half way along the horizontal axis… If that makes sense.

The free iPhone app Jump Rope uses the effect, and I believe the app was written in Corona.

Any advice gratefully received ! :slight_smile: [import]uid: 60457 topic_id: 30836 reply_id: 330836[/import]

Greetings,
Technically you can flip an object by multiplying its scale by -1… this isn’t a widely known trick, but it works. For example, to flip an image horizontally, you could multiply its xScale by -1; vertical flip would use yScale.

Try using this in a transition, setting the “target” xScale to -1 (assuming it’s 1 at the start, and you want a horizontal flip).

Let me know if that works and resolves your question.

Thanks,
Brent [import]uid: 9747 topic_id: 30836 reply_id: 123366[/import]

to put Brent’s great example into code:

transition.to(objectToFlip,{time=750, xScale=-1}) [import]uid: 19626 topic_id: 30836 reply_id: 123391[/import]

?Brent Sorrentino
I didn’t know that!!!
good trick!
thanks [import]uid: 25057 topic_id: 30836 reply_id: 123407[/import]

Greetings,
Technically you can flip an object by multiplying its scale by -1… this isn’t a widely known trick, but it works. For example, to flip an image horizontally, you could multiply its xScale by -1; vertical flip would use yScale.

Try using this in a transition, setting the “target” xScale to -1 (assuming it’s 1 at the start, and you want a horizontal flip).

Let me know if that works and resolves your question.

Thanks,
Brent [import]uid: 9747 topic_id: 30836 reply_id: 123366[/import]

to put Brent’s great example into code:

transition.to(objectToFlip,{time=750, xScale=-1}) [import]uid: 19626 topic_id: 30836 reply_id: 123391[/import]

?Brent Sorrentino
I didn’t know that!!!
good trick!
thanks [import]uid: 25057 topic_id: 30836 reply_id: 123407[/import]