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

currentRegistrationPointY()

Description Retrieves the y-component of an Animation's currently set registration point. To set the reg point, use setRegistrationPoint().
Prototype

float currentRegistrationPointY();

Parameters   (none)
Return float y-component of an Animation's current reg point.
Example

 

 

Animation test;
BImage img;
BFont font;

void setup()
{
  size(400,100);
  font = loadFont("RotisSanSer.vlw.gz");
  textFont(font, 20);
  img = loadImage("image.gif");
  
  test = new Animation(this, img, 100,40, 200,40);
  test.setStep("BOX");
  test.setDuration(5000);
  test.showRectangle();
  test.setRegistrationPoint(img.width*1/2, img.height*1/2);  
}

void loop()
{
  background(127);
  fill(255);
  float reg_y = test.currentRegistrationPointY(); // retrieve y-component of reg point.
  text("Registration point at y=" + reg_y, 25, 25);
  noFill();
  test.draw();
}