Stage::setTransparency()
Sets the stage's backdrop transparency to the percentage.
Examples
import org.openpatch.scratch.*;
public class StageSetTransparency {
public StageSetTransparency() {
Stage myStage = new Stage(600, 240);
myStage.addBackdrop("forest", "assets/background_forest.png");
myStage.wait(2000);
myStage.setTransparency(50);
;
myStage.wait(2000);
myStage.exit();
}
public static void main(String[] args) {
new StageSetTransparency();
}
}
Syntax
Java
.setTransparency(percentage)
Scratch
Parameters
Name | Data Type | Description |
---|---|---|
percentage | float | A value in percent in the range of 0 ... 255. |
Return
void