Creating an animation viewer
Manually Navigating Through Costumes
The primary object here is to show how easily Scratch can import an animated GIF and demonstrate how you can make a viewer for multiple animations. If, however, you are working with sets of themed images for which each sprite represents an album of photos, such as a trip to the beach, you can modify the control that plays the animation to advance to the next costume only on a key press. Alternatively, you could wire up buttons to ScratchGPIO to advance the images.
Figure 6 shows what a variation might look like using the Left and Right arrow keys. The Right arrow key advances to the next costume, and the Left arrow key goes back to the previous costume. To find the previous costume, you just subtract 1
from the current costume number.
« Previous 1 2 3 4 Next »
Buy this article as PDF
Pages: 4
(incl. VAT)