diff options
| author | Comment <tim@gray.(none)> | 2012-11-28 18:40:32 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2012-11-28 18:40:32 +0000 |
| commit | a0ab2cd35d91ba0080f9fb870d82aa90a51a0d6c (patch) | |
| tree | 0e0fd44d0f07ccf1ea4a5f1e30a03e0203300321 /vfg/src/Tag.cpp | |
| parent | 75c277c10f206f5bf3799caa03a52f40c1c8b6cf (diff) | |
nearly finished except latency
Diffstat (limited to 'vfg/src/Tag.cpp')
| -rwxr-xr-x | vfg/src/Tag.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vfg/src/Tag.cpp b/vfg/src/Tag.cpp new file mode 100755 index 0000000..e3ad080 --- /dev/null +++ b/vfg/src/Tag.cpp @@ -0,0 +1,18 @@ +#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::draw(float x, float y, float scale){
+ float time=((float)ofGetElapsedTimeMillis()-startTime)/duration;
+ float yshift=0.0f;
+ 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);
+ img.draw(x-(anchorPoint.x*scale),y-(anchorPoint.y*scale)+(yshift*img.getHeight()*scale),img.getWidth()*scale,img.getHeight()*scale);
+ if ((ofGetElapsedTimeMillis()-startTime)>duration) isPlaying=false;
+}
|
