Animation Overview - News - Installation - Reference - Examples - FAQ  
 

rectangleVisible()

Description This method returns the state of an Animation's rectangle, be it shown or hidden. This parameter can be set using showRectangle() and hideRectangle().
Prototype

boolean rectangleVisible();

Parameters   (none)
Return boolean True if an Animation's rectangle is currently shown; false if not.
Example

 

 

Animation test;
BFont font;

void setup()
{
  size(400,100);
  font = loadFont("RotisSanSer.vlw.gz");
  textFont(font, 20);
  
  test = new Animation(this, loadImage("image.gif"), 100,40, 200,40);
}

void loop()
{
  background(127);
  test.draw();

  if (test.rectangleVisible() == true) // get rectangle visibility status.
    text("Click to hide the rectangle.", 25, 25);
  else
    text("Click to show the rectangle.", 25, 25);
}

void mousePressed()
{
  if (test.rectangleVisible())
    test.hideRectangle();
  else
    test.showRectangle();
}