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.

Figure 6: Variation using keyboard arrows.

The Author

Michael Badger wrote the Scratch 1.4 and 2.0 Beginner's Guide series from Packt Publishing. Learn more at http://scratchguide.com

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content