Stage::display()
Ein Textfeld zeigt sich am unteren Bildschirmrand.
Beispiele

import org.openpatch.scratch.*;
public class StageDisplay {
public StageDisplay() {
Stage myStage = new Stage(600, 240);
myStage.display(
"Welcome! This is a longer text with auto line breaks! So if you write a long sentence it"
+ " should wrap to the next line and the height of the box should increase.",
2000);
myStage.wait(2000);
myStage.exit();
}
public static void main(String[] args) {
new StageDisplay();
}
}
Syntax
Java
.display(text)
.display(text, milliseconds)
Scratch
dispaly [Hi!] display [Hi!] for (5) seconds
Parameter
Name | Datentyp | Beschreibung |
---|---|---|
text | String | Inhalt des Textfeldes |
milliseconds | int | Zeit bis das Textfeld verschwindet |
Rückgabe
void