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

h()

Description Returns the height of an Animation's rectangle. To set this parameter outside the constructor, use setRectangle().
Prototype

float h();

Parameters   (none)
Return float Height of the animation-rectangle, in pixels.
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();
  float height = test.h(); // get animation-rectangle height.
  text("This animation is " + height + "  pixels high.", 25, 25);
}