Introduction
In this training, you will learn how to construct an Animation class and add animations to a label.
Steps:
- PropertyAnimator Class
Prerequisites
You have prepared the Host PC with all the development software tools and Ensemble Graphics Toolkit source code as explained in:
You have installed and prepared the Eclipse IDE for C/C++ Developers as explained in:
You have performed the exercises in:
PropertyAnimator Class
In this section, you will modify the timer.cpp source code that you entered in the Ensemble Graphics Toolkit: Timers training to construct an Animation class and add an animation to the “Ensemble Graphics Toolkit” Label.
In this training, you will use EgtProject and its settings you entered in the Ensemble Graphics Toolkit: Timers training.
1
Modify the timer.cpp source code by adding the following lines of code as shown:
2
Save your program by selecting File > Save. You may also save by pressing CTRL + S.
3
To build the project, hover over EgtProject, right-click and select Build Project from the menu. Or you can click on the Build icon.
The Console window (bottom pane) will display the build progress.
4
Click on the Run button.
5
Observe the WVGA Display on the target:
The timer.cpp executable is running remotely on the target.
Observe the Label “Ensemble Graphics Toolkit” at the top of the WVGA Display move (animate) along the “easing_bounce” curve for a duration of five seconds.
PropertyAnimatorType class
From ~/egt/docs/html/annotated.html, click on the PropertyAnimatorType class. All the functions, attributes and constructor associated with the class are documented here.
on_change
This function allows you to register a callback handler to be called when the value changes.
6
To stop the program, press the Stop button (upper left hand, just below the menu bar).
Before you start another session, be sure to stop the current session.
Summary
In this training, you learned how to construct an Animation class and add an animation to a label.
What’s Next?
There’s plenty more to learn. Here are some additional Ensemble Graphics Toolkit training resources to help you gain more knowledge and skills: