- The correct title of this article is Costume # (value). The Scratch Wiki uses this different title because of technical restrictions.
The Costume # (or "backdrop #" for the stage) is a local value which is set to the current costume or backdrop of the sprite (or stage) that it is specific to. Every costume has both a name and number identifying their position in the costumes pane in the Paint Editor. The costume # value resembles the position of order the costume is in. For example, the costume at the top of the costumes pane has a value of 1 while the one below it is 2. The values are completely separate from the costume names, and often naming costumes numbers can confuse Scratch with the name and costume # value.
There is a block that reports this value for each sprite; therefore a variable can be set to a costume's number. For example:
when gf clicked forever set [variable v] to (costume [number v])
Related Blocks
The following blocks can be used in conjunction with this value:
(costume [ v])
— The Stage Monitor and reporter block of the costume # or name valueswitch costume to ( v)
— Switches to a certain costume, therefore changing the costume # valuenext costume
— Switches to the next available costume by changing the costume # by 1
Example Uses
This value can be used in a number of ways:
- Reporting what costume a sprite is on
- Doing an action if the costume is a certain number
- Detecting if a switch is on or off based on its appearance