Scratch for Java

Sprite::changeTransparency()

Change the transparency by a given amount.

Examples

import org.openpatch.scratch.*;
 
public class SpriteChangeTransparency {
  public SpriteChangeTransparency() {
    Stage myStage = new Stage(600, 240);
    Sprite mySprite = new Sprite("zeta", "assets/zeta_green_badge.png");
    myStage.add(mySprite);
 
 
    myStage.wait(2000);
    mySprite.changeTransparency(150);
    myStage.wait(2000);
 
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new SpriteChangeTransparency();
  }
}
 

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()