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);
test.showRectangle();
test.setDuration(5000);
}
void loop()
{
background(127);
test.draw();
float x = test.currentX(); // get x-component of current position
text("Current x position: " + x,25,25);
}
|