Stage::showVariable()
Shows a monitor for a variable in the top left corner of the stage, like Scratch's variable monitors: the name and the current value, updated every frame. Showing the same name again replaces the monitor.
this.showVariable("score", () -> score);
Examples
Syntax
Java
.showVariable(name, value)
Scratch
show variable [name v]
Parameters
| Name | Data Type | Description |
|---|---|---|
| name | String | what the monitor says |
| value | Supplier<?> | gives the value to show; asked for it every frame |
Return
void