Scratch for Java

Stage::changeTransparency()

Change the transparency by a given amount.

Examples

import org.openpatch.scratch.*;
 
public class StageChangeTransparency {
  public StageChangeTransparency() {
    Stage myStage = new Stage(600, 240);
    myStage.addBackdrop("forest", "assets/background_forest.png");
    myStage.wait(2000);
    myStage.changeTransparency(40);
    myStage.wait(2000);
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new StageChangeTransparency();
  }
}
 

View on GitHub

Syntax

Java

.changeTransparency(amount)

Scratch

change [ghost v] effect by (25)

Parameters

Name Data Type Description
amount float Changes the tint by the amount.

Return

void

changeTransparency()