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

say [Hi!] say [Hi!] for (5) seconds

Parameters

Name Data Type Description
text String Text for the speech bubble.
milliseconds int Time for the speech bubble to stay.

Return

void

say()