diff options
| author | Tim Redfern <redfernt@gmail.com> | 2023-08-18 17:02:19 +0100 |
|---|---|---|
| committer | Tim Redfern <redfernt@gmail.com> | 2023-08-18 17:02:19 +0100 |
| commit | 4d2fda8f0807957b9fbcf77656aa361c5954db9f (patch) | |
| tree | 1e8e16b7a4eeaef5be738eac446db671c200f17e /lasertext/src/vectortext.h | |
| parent | 02aa1fbd6e4caf284917c4dcb0be9f3ee6eef776 (diff) | |
override works
Diffstat (limited to 'lasertext/src/vectortext.h')
| -rw-r--r-- | lasertext/src/vectortext.h | 8 |
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); |
