AnimatedSprite::getAnimationFrame()
Gets the current animation frame.
Examples

import org.openpatch.scratch.*;
import org.openpatch.scratch.extensions.animation.*;
public class AnimatedSpriteGetAnimationFrame {
public AnimatedSpriteGetAnimationFrame() {
Stage myStage = new Stage(254, 100);
AnimatedSprite bee = new AnimatedSprite();
bee.addAnimation("idle", "assets/bee_idle.png", 6, 36, 34);
myStage.add(bee);
bee.changeY(20);
while (myStage.getTimer().forMillis(5000)) {
bee.playAnimation("idle");
bee.say("Frame: " + bee.getAnimationFrame());
}
Window.getInstance().exit();
}
public static void main(String[] args) {
new AnimatedSpriteGetAnimationFrame();
}
}
Syntax
Java
.getAnimationFrame()
Scratch
Return
int