summaryrefslogtreecommitdiff
path: root/nextus/src/vectorPlugin.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2023-04-19 17:50:24 +0100
committerTim Redfern <tim@getdrop.com>2023-04-19 17:50:24 +0100
commitaf30d07a90f4c64baedcc383b7e5ee572de56aee (patch)
tree1e503049c32173dbdb05505bf7761f67434ba8ce /nextus/src/vectorPlugin.h
parent66b4e761440da66be27fc2cbe486c6e21ba03f34 (diff)
text panel compiles
Diffstat (limited to 'nextus/src/vectorPlugin.h')
-rw-r--r--nextus/src/vectorPlugin.h81
1 files changed, 79 insertions, 2 deletions
diff --git a/nextus/src/vectorPlugin.h b/nextus/src/vectorPlugin.h
index e20be8f..d772b0b 100644
--- a/nextus/src/vectorPlugin.h
+++ b/nextus/src/vectorPlugin.h
@@ -7,6 +7,7 @@
#include "ofxPONK.h"
#include "lineTransformer.h"
#include "lineSegmenter.h"
+#include "vectorText.h"
static ofVec2f DISPLAYSIZE(200,200);
@@ -183,5 +184,81 @@ class textPanel: public vectorPanel{
string _title="",
ofVec2f _size=DISPLAYSIZE,
ofVec2f _pos=ofPoint(5,5)
- ) : vectorPanel(_title,_size,_pos){}
-} \ No newline at end of file
+ ) : vectorPanel(_title,_size,_pos){
+ panel.add(use_beat.set("use beat", false));
+ panel.add(beat_duration.set("duration factor", 0.5f, 0.0f, 1.0f));
+ panel.add(text_speed.set("speed", 5.0f, 0.0f, 25.0f));
+ panel.add(text_scale.set("scale", 0.1f, 0.0f, 0.5f));
+ panel.add(enable_anim.set("animate", false));
+ panel.add(anim_rev.set("reverse", false));
+ panel.add(vert_pos.set("vert_pos", 0.0f, -0.3f, 0.3f));
+ panel.add(vert_spread.set("vert_spread", 0.0f, -0.3f, 0.3f));
+ }
+ vector<colourPolyline> getLines(){
+ vector<colourPolyline> output;
+ return output;
+ }
+ protected:
+ ofParameter<bool> use_beat;
+ ofParameter<float> beat_duration;
+ ofParameter<float> text_speed;
+ ofParameter<float> text_scale;
+ ofParameter<bool> enable_anim;
+ ofParameter<bool> anim_rev;
+ ofParameter<float> vert_pos;
+ ofParameter<float> vert_spread;
+ glyphbanner text;
+};
+/*
+class textgui : public ofxPanel{
+ public:
+ ofParameter<bool> use_beat;
+ ofParameter<float> beat_duration;
+ ofParameter<float> text_speed;
+ ofParameter<float> text_scale;
+ ofParameter<bool> enable_anim;
+ ofParameter<bool> anim_rev;
+ ofParameter<float> vert_pos;
+ ofParameter<float> vert_spread;
+ glyphbanner text;
+ int onset_frame;
+ void loadfile(const string & f){
+ if (!strcmp(strchr(f.c_str(), '\0') - 4, ".plt")){
+ text.loadPalette(f);
+ }
+ else {
+ text.load(f);
+ }
+ }
+ void setup(int x, int y){
+ //text.loadFont("fonts/EMSSpaceRocks.svg");
+ text.loadFont("fonts/EMSOsmotron.svg");
+
+ ofxPanel::setup("text","",x,y);
+ ofxPanel::add(use_beat.set("use beat", false));
+ ofxPanel::add(beat_duration.set("duration factor", 0.5f, 0.0f, 1.0f));
+ ofxPanel::add(text_speed.set("speed", 5.0f, 0.0f, 25.0f));
+ ofxPanel::add(text_scale.set("scale", 0.1f, 0.0f, 0.5f));
+ ofxPanel::add(enable_anim.set("animate", false));
+ ofxPanel::add(anim_rev.set("reverse", false));
+ ofxPanel::add(vert_pos.set("vert_pos", 0.0f, -0.3f, 0.3f));
+ ofxPanel::add(vert_spread.set("vert_spread", 0.0f, -0.3f, 0.3f));
+
+ }
+ void update(int oframe=0){
+ onset_frame=oframe;
+ text.update(text_speed,true);
+ }
+ void drawgui(int oframe=0){
+ onset_frame=oframe;
+ ofxPanel::draw();
+ }
+ void createWords(string t){
+ text.createWords(t);
+ }
+ vector<colourPolyline>& getOutlines(float x=0, float y=0){
+ return text.getOutlines(text_scale,STYLE_OVERLAPPING,x,y+(ofGetHeight()*vert_pos),enable_anim,anim_rev,vert_spread,use_beat,beat_duration);
+ }
+
+};
+*/ \ No newline at end of file