Scratch for Java

Sprite::say()

A speech bubble appears over the sprite and will only go away if the sprite says or thinks something else.

Examples

import org.openpatch.scratch.*;

public class SpriteSay {
  public SpriteSay() {
    Stage myStage = new Stage(600, 240);
    Sprite zeta = new Sprite("green", "assets/zeta_green_badge.png");
    myStage.add(zeta);
    zeta.say("Hi! I'm Zeta and can say line breaks");
    myStage.wait(3000);
    myStage.exit();
  }

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

View on GitHub

Syntax

Java

.say(text)
.say(text, milliseconds)

Scratch

Parameters

NameData TypeDescription
textStringText for the speech bubble.
millisecondsintTime for the speech bubble to stay.

Return

void