From cde8fab86a40be5d3c99bfd2d97605638647179f Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 20 Sep 2023 23:35:53 +0100 Subject: mostly works --- futuregael/src/show.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'futuregael/src/show.h') diff --git a/futuregael/src/show.h b/futuregael/src/show.h index c5a7605..45d0023 100644 --- a/futuregael/src/show.h +++ b/futuregael/src/show.h @@ -13,6 +13,7 @@ public: clear(); vector m=ofSplitString(message," "); + width=0; for (auto& word: m){ glyphWord w; int pos=0; @@ -28,8 +29,10 @@ public: ofColor::fromHsb(ofRandom(119)+112,ofRandom(255),255) )); pos++; + w.width+=w.glyphs[w.glyphs.size()-1].width; } words.push_back(w); + width+=(w.width+enspace); } if (audio.load(audiofile)){ @@ -49,8 +52,9 @@ public: words.clear(); } vector& getOutlines(float time){ + float wordphase=time/duration; float phase=time/avgWordDuration; - float phaseseg=fmod(phase,(int)phase); + float phaseseg=fmod(phase,1.0f); //ofLog()<<"phase "<-1&&word1 outlines; float enspace; + float width; }; -- cgit v1.2.3