diff options
| author | Comment <tim@gray.(none)> | 2012-12-11 23:13:02 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2012-12-11 23:13:02 +0000 |
| commit | 1db97e28061caec0b3e8ce998b92e1936edbf2e5 (patch) | |
| tree | 009549456ccd3529e15be353672c63cdf414db4a /vfg/src/Tag.cpp | |
| parent | 7867f3fb1842639ce5f1b6e66b010cea7028f5cc (diff) | |
numerous bugfixes
Diffstat (limited to 'vfg/src/Tag.cpp')
| -rwxr-xr-x | vfg/src/Tag.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/vfg/src/Tag.cpp b/vfg/src/Tag.cpp index e3ad080..bc087e6 100755 --- a/vfg/src/Tag.cpp +++ b/vfg/src/Tag.cpp @@ -8,11 +8,20 @@ void Tag::play(){ isPlaying=true;
startTime=ofGetElapsedTimeMillis();
}
-void Tag::draw(float x, float y, float scale){
+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 (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 (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);
- if ((ofGetElapsedTimeMillis()-startTime)>duration) isPlaying=false;
}
|
