Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Some animations run on their own, but others require some kind of user interaction. Users typically interact with animations by user gestures, usually with mouse or fingers, on the desktop or mobile devices, respectively.
The application shown in Figure 5.12 is the same magnifying glass application discussed in Section 4.10, “A Magnifying Glass,” on p. 321. However, this version of the magnifying glass lets the user throw the magnifying glass by quickly dragging and releasing it. Once the user throws it, the magnifying glass continues to move in the direction of the throw, at a speed relative to the speed of the throw. When the magnifying glass reaches an edge of the canvas, it bounces off the edge and continues animating. Figure 5.12 shows the magnifying glass animating.