summaryrefslogtreecommitdiff
path: root/nextus/src/vectorText.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2023-04-23 23:22:38 +0100
committerTim Redfern <tim@getdrop.com>2023-04-23 23:22:38 +0100
commit9e0236016f5d6afd3a73edad183dfb2b02387e98 (patch)
tree5589b5010a1de6eed1650493e812179b84e6e3c6 /nextus/src/vectorText.h
parentcdb92d8c8532a287b752a92f1cf0cbf88d52c117 (diff)
many fixes for Nextus show at the complex April 22 2023
Diffstat (limited to 'nextus/src/vectorText.h')
-rw-r--r--nextus/src/vectorText.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/nextus/src/vectorText.h b/nextus/src/vectorText.h
index f6c4df4..4fb7520 100644
--- a/nextus/src/vectorText.h
+++ b/nextus/src/vectorText.h
@@ -48,8 +48,9 @@ public:
float width;
};
-#define STYLE_SENTENCE 1
-#define STYLE_OVERLAPPING 2
+#define STYLE_WORDS 0
+#define STYLE_OVERLAPPING 1
+#define STYLE_SENTENCE 2
class glyphbanner{
ofXml SVGFont;
@@ -325,22 +326,26 @@ public:
int drawglyphs=0;
int drawlines=0;
+ float a=anim?reverse?1.0f-segment:segment:1.0;
+
switch (style){
- case STYLE_SENTENCE:{
- float p=((-width())/2);
+ case STYLE_WORDS:{
for (auto& w:words){
+ float p=(w.val*(2.0-w.width)); //was screen based now 2.0
+ float v=y+(vert_spread*w.val*(2.0)); //was screen based now 2.0
for (auto& g:w.glyphs){
if (w.amount>0.0f&&g.colour.getBrightness()>0){
+ drawglyphs++;
for (auto& o:g.outline){
+ drawlines++;
auto q=o;
- q.scale(s,-s);
- q.translate(glm::vec3((p*s)+x,y,0));
+ q.scale(s*a,-s*a);
+ q.translate(glm::vec3((p*s*a)+x,v,0));
outlines.push_back(colourPolyline(q,g.colour*w.amount));
}
}
- p+=g.width;
+ p+=g.width;
}
- p+=enspace;
}
break;
}
@@ -354,15 +359,33 @@ public:
for (auto& o:g.outline){
drawlines++;
auto q=o;
- float a=anim?reverse?1.0f-segment:segment:1.0;
q.scale(s*a,-s*a);
q.translate(glm::vec3((p*s*a)+x,v,0));
outlines.push_back(colourPolyline(q,g.colour*w.amount));
}
}
- p+=g.width*(anim?reverse?1.0f-segment:segment:1.0);
+ p+=g.width*(anim?a:1.0);
+ }
+ }
+ break;
+ }
+ case STYLE_SENTENCE:{
+ float p=((-width())/2);
+ for (auto& w:words){
+ for (auto& g:w.glyphs){
+ if (w.amount>0.0f&&g.colour.getBrightness()>0){
+ for (auto& o:g.outline){
+ auto q=o;
+ q.scale(s,-s);
+ q.translate(glm::vec3((p*s)+x,y,0));
+ outlines.push_back(colourPolyline(q,g.colour*w.amount));
+ }
+ }
+ p+=s*g.width;
}
+ p+=s*enspace;
}
+ break;
}
default:{
break;