Scratch for Java

Diese Seite ist noch nicht übersetzt. Sie wird in ihrer Originalsprache angezeigt.

ActionListener()

What a stage or sprite is told about actions, at the same point of the tick as key events (before run()): an action starting (one of its keys or buttons went down, or a stick was pushed more than halfway) and ending. Like keys, the stage and every sprite on it that implements this are told.

public class Player extends Sprite implements ActionListener {
  public void whenActionPressed(String action) {
    if (action.equals("jump")) {
      this.jump();
    }
  }
}

Examples

View on GitHub

ActionListener()

Teilbare URL erstellen

Abschnitte auswählen