Category:Sprites

Gets the sprite with the specified name.

This block does nothing on its own and is meant to be inserted into other blocks, such as actions or events like set sprite property or sprite clicked. The sprite name block is used to choose which sprite is affected.

The default name is “mySprite,” but there is an option to use a new name (“rename this sprite”) or to change the name of a sprite throughout your program (“rename all”).

Parameters

NameDescription
name The default name is “mySprite,” but there is an option to rename. In addition, the rename can be applied to all sprite name blocks in the code currently using that name.

Tips

  • Using a descriptive sprite name helps best identify a specific sprite and makes it easier for anyone else reading the code to understand what is happening.
  • Choosing to “rename all” sprites with that name will automatically rename all the matching blocks used in your project.

Found a bug in the documentation? Let us know at documentation@code.org