This post was originally published at Tutorial Treasury: Transitions

This week we are launching our new “Tutorial Treasury” series. Its purpose is to refresh and consolidate instructional material — past tutorials, guides, videos, etc. — around a central theme. Over the next several weeks, we will share various collections of resources, giving you a chance to review topics and tutorials which you may have missed.

Transitions

This week’s theme is transitions. Essentially, transitions are a way to transform an object from one state to another in a smooth manner. This includes gradually moving an object from one position to another, scaling the size of an object, rotating an object, or adjusting an object’s alpha value over a specific amount of time.

Overview

In Corona, all transitions are done using methods within the transition library. These methods let you transform any display object from one state to another over a defined time period. The transition library also includes various convenience methods which allow you to easily perform a transition in one line of code.

In addition, transitions can be performed in a non-linear manner via the easing library, including quadratic, exponential, elastic, and much more.

Video Introduction

This introductory video covers basic usage of the transition library.

Tutorials

Swiping an object to a fixed point

In the following tutorial, we showed you how to use screen touch events to detect swipe actions and, as a result of that action, transition an object to a specific position on the screen.

Moving objects along a path

Many applications need to move objects along a path. It may be as simple an opening or closing a door in a platform game, or moving an enemy toward the player for a pending attack. Paths can, of course, be either a straight line, a bezier curve, or a free-form path. We covered all of these topics in the following tutorials:

Further Reading

Sample Code

Conclusion

In summary, transitions are a great way to add animation to your app. Using the transition library in addition to the easing library, you can easily add life to your creation.


Jump to original: 

This post was originally published at Tutorial Treasury: Transitions