Scratch for Java

Sprite::playAnimation()

Plays an animation, over and over. Call it every tick (in run()): it shows the next frame each time the animation interval has passed, and starts from the first frame when another animation was playing before.

Syntax

Java

.playAnimation(name)
.playAnimation(name, once)

Parameters

Name Data Type Description
name String the animation's name
once boolean whether to stop at the last frame instead of starting over

Return

void

playAnimation()

Create Shareable URL

Select Sections