Scratch for Java

Sprite::isVisible()

Returns false if the sprite is hidden.

Examples

import org.openpatch.scratch.*;
 
public class SpriteIsVisible {
  public SpriteIsVisible() {
    Stage myStage = new Stage(600, 240);
    Sprite gamma = new Sprite("gamma", "assets/gamma_purple_badge.png");
    myStage.add(gamma);
    myStage.display("Gamma Visible? " + gamma.isVisible());
    myStage.wait(2000);
    gamma.hide();
    myStage.display("Gamma Visible? " + gamma.isVisible());
    myStage.wait(2000);
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new SpriteIsVisible();
  }
}
 

View on GitHub

Syntax

Java

.isVisible()

Scratch

(visible)

Return

boolean

isVisible()