Scratch für Java

Sprite::getCurrentCostumeName()

Gibt den aktuellen Kostümnamen zurück.

Beispiele

import org.openpatch.scratch.*;
 
public class SpriteGetCurrentCostumeName {
  public SpriteGetCurrentCostumeName() {
    Stage myStage = new Stage(600, 240);
    Sprite mySprite = new Sprite("zeta", "assets/zeta_green_badge.png");
    mySprite.addCostume("gamma", "assets/gamma_purple_badge.png");
    myStage.add(mySprite);
 
 
    mySprite.think("Name: " + mySprite.getCurrentCostumeName());
    myStage.wait(2000);
    mySprite.nextCostume();
    mySprite.think("Name: " + mySprite.getCurrentCostumeName());
    myStage.wait(2000);
 
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new SpriteGetCurrentCostumeName();
  }
}
 

Auf GitHub anschauen

Syntax

Java

.getCurrentCostumeName()

Scratch

costume [name v]

Rückgabe

String

getCurrentCostumeName()