How to Get Number of Costumes of a Sprite
Шаблон:Wiki Standards Шаблон:Expand It is possible to find how many costume numbers a sprite has in Scratch. This is a tutorial on how to find how much costumes a sprite has.
This can be used to debug sprites.
Setup
One method is to use the following script:
Then, run the project and the variable should report how many costumes a sprite has.
This method works because the block uses the formula:
<ref>https://github.com/LLK/scratch-vm/blob/develop/src/blocks/scratch3_looks.js#L392</ref><ref>https://github.com/LLK/scratch-vm/blob/develop/src/sprites/rendered-target.js#L438</ref><ref>https://github.com/LLK/scratch-vm/blob/develop/src/util/math-util.js#L42</ref><ref>https://github.com/LLK/scratch-vm/blob/develop/src/blocks/scratch3_looks.js#L605</ref>
to determine which Шаблон:Val to select, which—with 0 as the input—evaluates to:
One can also do:
Even though the previous way is easier and faster, this also works.
References
<references />