Chapter 7. Animation

One of the features that make OpenLaszlo so appealing is animation. Animation is easy to achieve in OpenLaszlo. Basically, to animate an object you dynamically change the value of its attribute(s). A view whose x attribute gets incremented every second will move along the X axis. Keep changing the rotation attribute of a view, and you’ll see it rotate.

There are two related tags you need to learn: animator and animatorGroup. You use the animator tag within an object to perform a movement. The animatorGroup tag is used to group multiple animator tags to perform more than one animation type. With the animator tag, you can also repeat a movement multiple times or even indefinitely. Another way to perform animation is by using the animate method of the LzNode class.

In addition, the LzTimer class can be used to invoke a method after a specified period of time elapses. Invoking an LzTimer object a few times will also simulate animation. We will look at the LzTimer class at the end of this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset