Animations are used to give objects a more dynamic behaviour, e.g. when entering a dialog different buttons could be animated to the left to form a group of controls. Or when clicking on a central button other button could appear around this button to give access to submenus.
Animations can also be summed up into an AnimationChain for easier control of complex flows.
It is also possible to create and attach an AnimationObserver to be notified of state-changes of the Animation (e.g. running or stopping).
Animations are triggered from the Timer-module in Guiliani's main loop via DoAnimate-method. Inside this method each Animations does specific calculations and updates bounded object's accordingly. These are the parts an Animations consists of:
Like all other objects in Guiliani all neccessary internal stuff gets initialized at the beginning. If Streaming is used this data comes from the InputStream. Animations are accessed through the AnimationHandler with IDs generated on creation of the Animation.
When the Animation is started the derived method InitAttributes is called. Typically here the object is set to the starting-state (e.g. position, size or alpha-value) the Animation defines. After that the Timer is set up to call the DoAnimate-method according to the cycle-time of the Animation
This method is called according to the cycle-time of the Animation. Typically here the attributes of the animated object is changed and the object is marked for redraw. Easings can be used to easily create value-changes in a lot more ways than just linear.