

The full code for this example can be found at \mbox{\hyperlink{transit_example_01_c}{Transit example 1}}.

This example shows the simplest way of creating a transition and applying it to an object. Similarly to every other elementary example, we create a window, set its title, size, autodel property, and setup a callback to exit the program when finished\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 We also add a resizable white background to use behind our animation\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 And then we add a button that we will use to demonstrate the effects of our animation\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 Notice that we are not adding the button with \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\+\_\+win\+\_\+resize\+\_\+object\+\_\+add()}} because we don\textquotesingle{}t want the window to control the size of the button. We will use the transition to change the button size, so it could conflict with something else trying to control that size.

Now, the simplest code possible to create the resize animation\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}
 As you can see, this code is very easy to understand. First, we create the transition itself with \mbox{\hyperlink{group__Elm__Transit_gaae9b4e656862c3e70b2946dc0d4642d7}{elm\+\_\+transit\+\_\+add()}}. Then we add the button to this transition with \mbox{\hyperlink{group__Elm__Transit_gab4e46606ff9cf54591289bffe193c03b}{elm\+\_\+transit\+\_\+object\+\_\+add()}}, which means that the transition will operate over this button. The effect that we want now is changing the object size from 100x50 to 300x150, and can be achieved by adding the resize effect with \mbox{\hyperlink{group__Elm__Transit_ga75eeedddda3a3195c0349bfa26d4b61b}{elm\+\_\+transit\+\_\+effect\+\_\+resizing\+\_\+add()}}.

Finally, we set the transition time to 5 seconds and start the transition with \mbox{\hyperlink{group__Elm__Transit_ga5d600d1d615b5136b99a180d256cb147}{elm\+\_\+transit\+\_\+go()}}. If we wanted more effects applied to this button, we could add them to the same transition. See the \mbox{\hyperlink{transit_example_03_c}{elm\+\_\+transit -\/ Combined effects and options.}} to watch many transitions being applied to an object. 