Changes the costume of a sprite or group of sprites.
This block can make a sprite look different without changing its location or properties.
Examples
Example 1
A costume change can be triggered by an event. For example, when the alien is pressed, it changes all the green fish costumes to pink fish costumes.
Example 2
Just one sprite can be changed by name. In this case, there is one alien pretending to be like the others. When that alien clicked, it reveals its true self.
Syntax
setAnimation
Parameters
Name | Type | Required? | Description |
---|---|---|---|
costume | Each Sprite Lab project or level will include some default sprite costumes, but you can also choose from a larger costume library or draw your own using the built-in pixel editor. | ||
sprite | The sprite or group of sprites whose costume is changing |
Found a bug in the documentation? Let us know at support@code.org.