Scratch for Java

Stage::remove()

Remove a drawable for example a sprite to the stage

Examples

import org.openpatch.scratch.*;

public class StageRemove {
  public StageRemove() {
    Stage myStage = new Stage(600, 240);
    Sprite gamma = new Sprite("gamma", "assets/gamma_purple_badge.png");
    myStage.add(gamma);
    myStage.wait(2000);
    myStage.remove(gamma);
    myStage.wait(2000);
    myStage.exit();
  }

  public static void main(String[] args) {
    new StageRemove();
  }
}

View on GitHub

Syntax

Java

.remove(sprite)

Scratch

Parameters

NameData TypeDescription
spriteDrawableA reference to a drawable. For example a sprite.

Return

void