summaryrefslogtreecommitdiff
path: root/lasertext/src/vectortext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lasertext/src/vectortext.h')
-rw-r--r--lasertext/src/vectortext.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lasertext/src/vectortext.h b/lasertext/src/vectortext.h
index 69ea98c..6fa8acc 100644
--- a/lasertext/src/vectortext.h
+++ b/lasertext/src/vectortext.h
@@ -213,8 +213,14 @@ public:
}
}
void clear(){words.clear();}
+ bool firstPass(){
+ if(!words.size()) return false;
+ return playhead<glyphCount();
+ }
void update(float speed=1.0f,float usePalette=false){
+ if(!words.size()) return;
+
float delta=ofGetElapsedTimef()-lastUpdateTime;
lastUpdateTime=ofGetElapsedTimef();
playhead+=delta*speed;
@@ -240,7 +246,7 @@ public:
//segment=(((float)theletter+words[theword].glyphs.size()+playhead-int(playhead))/words[theword].glyphs.size());
segment=(((float)theletter+playfraction-1)/words[theword].glyphs.size());
- }
+ }
//calculate params for word/letter anim
for (int i=0;i<words.size();i++){
words[i].amount=(i==theword?sin(segment*3.14):0);