Scratch for Java

Stage::getAll()

Get all objects added to the stage.

Examples

import org.openpatch.scratch.*;
import org.openpatch.scratch.extensions.pen.*;

public class StageGetAll {
  public StageGetAll() {
    Stage myStage = new Stage(600, 240);
    myStage.add(new Pen());
    myStage.add(new Sprite());
    myStage.add(new Sprite());

    myStage.display("All: " + myStage.getAll().size());
    myStage.wait(2000);
    myStage.exit();
  }

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

View on GitHub

Syntax

Java

.getAll()

Scratch

Return

List