#include "testApp.h" //-------------------------------------------------------------- void testApp::setup(){ ofSetVerticalSync(true); ofSetFrameRate(60); ofBackground(255, 255, 255); elRect[0].setColor(0x009cd6); elRect[1].setColor(0xb7006a); elRect[2].setColor(0xf3de00); elRect[3].setColor(0x1f1f1f); for (int i=0; i<4; i++) { elRect[i].pos.x = (ofGetWidth()/2); elRect[i].pos.y = (ofGetHeight()/2); float speed = (i+1)*0.05f; elRect[i].setCatchSpeed(speed); elRect[i].xenoToPoint(elRect[i].pos.x, elRect[i].pos.y); } } //-------------------------------------------------------------- void testApp::update(){ for (int i=0; i<4; i++) { elRect[i].xenoToPoint(mouseX, mouseY); } } //-------------------------------------------------------------- void testApp::draw(){ for (int i=0; i<4; i++) { elRect[i].draw(); char speedTxt[1024]; sprintf(speedTxt, "%f", (float)elRect[i].catchUpSpeed); ofSetColor(0x999999); ofDrawBitmapString(speedTxt, elRect[i].pos.x+20, elRect[i].pos.y+30); } }