#include "Tag.h" void Billboard::draw(float x, float y, float scale){ img.draw(x-(anchorPoint.x*scale),y-(anchorPoint.y*scale),img.getWidth()*scale,img.getHeight()*scale); } void Tag::play(){ isPlaying=true; startTime=ofGetElapsedTimeMillis(); } void Tag::1playEnd(){ end=true; play(); } void Tag::draw(float x, float y, float scale) { float time=((float)ofGetElapsedTimeMillis()-startTime)/duration; float yshift=0.0f; if (end) { if (time<1.0) yshift=pow((time),0.7)-1.0; } else { if (time<0.4) yshift=pow((time/0.4),0.7)-1.0; else if (time>0.75) yshift=-pow((time-0.75)/0.25,0.75); if ((ofGetElapsedTimeMillis()-startTime)>duration) isPlaying=false; } img.draw(x-(anchorPoint.x*scale),y-(anchorPoint.y*scale)+(yshift*img.getHeight()*scale),img.getWidth()*scale,img.getHeight()*scale); }