Chapter 8. Animation and Special Effects
Animation can add a splash of character to an otherwise bland
application. This chapter systematically works through the animation
utilities that are built right into Base as well as the dojo.fx (pronounced "effects") module that
Core provides. This chapter includes a lot of source code and the bulk
of the content builds upon only a few other concepts covered in earlier
chapters. As such, this chapter may prove useful as a near-standalone
reference.
Animation
The toolkit provides animation facilities in Base and
supplements them with additional functionality offered through
dojo.fx. The stock functionality
offered by Base includes _Animation, a class that acts as a delegate
in that it fires callbacks according to its configuration; these
callback functions are what manipulate properties of a node so that it
animates. Once instantiated, all that has to be done to execute an
_Animation is to invoke its
play method.
Warning
The leading underscore on the _Animation class currently designates at
least two things:
The API isn't definitively final yet, although it is really stable and probably will not change much (if any) between version 1.1 of the toolkit and when it does become final.
You generally won't be creating an
_Animationdirectly. Instead, you'll rely on auxiliary functions from Base anddojo.fxto create, wrap, and manipulate them on your behalf. You will, however, usually need to run theirplaymethods to start them.
Simple Fades
Before delving ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access