From 4d2fda8f0807957b9fbcf77656aa361c5954db9f Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 18 Aug 2023 17:02:19 +0100 Subject: override works --- lasertext/src/ofApp.cpp | 23 +++++++++++++++++------ lasertext/src/ofApp.h | 1 + lasertext/src/vectortext.h | 8 +++++++- 3 files changed, 25 insertions(+), 7 deletions(-) (limited to 'lasertext') diff --git a/lasertext/src/ofApp.cpp b/lasertext/src/ofApp.cpp index e58e361..b0442bb 100644 --- a/lasertext/src/ofApp.cpp +++ b/lasertext/src/ofApp.cpp @@ -28,6 +28,7 @@ void ofApp::setup(){ //banner.init("Everything Is Going To Be Alright"); banner.init("No Pleasure is Too Guilty"); + override_banner.loadFont("fonts/EMSQwandry.svg"); stars1.init("stars 1",990,10); stars2.init("stars 2",990,205); @@ -161,6 +162,7 @@ void ofApp::save_settings(){ //-------------------------------------------------------------- void ofApp::update(){ banner.update(text_speed,true); + override_banner.update(text_speed,true); laser.set_pts(laser_points); laser.set_subdivide(laser_subdivide); @@ -204,7 +206,14 @@ void ofApp::draw(){ ofMatrix4x4 warp =lineTransformer::getPerspectiveTransformMatrix(src,warpframe); - vector shapes = banner.getOutlines(0.08f); //*text_scale); //+(0.02f*sin(ofGetElapsedTimef()*.1f))); + vector shapes; + + if (override_banner.firstPass()){ + shapes = override_banner.getOutlines(0.08f); //*text_scale); //+(0.02f*sin(ofGetElapsedTimef()*.1f))); + } + else { + shapes = banner.getOutlines(0.08f); //*text_scale); //+(0.02f*sin(ofGetElapsedTimef()*.1f))); + } ofMatrix4x4 rm = ofMatrix4x4::newIdentityMatrix(); rm.translate(laser_pos_x,laser_pos_y,0); @@ -278,7 +287,7 @@ void ofApp::keyPressed(ofKeyEventArgs &args){ //-------------------------------------------------------------- void ofApp::keyReleased(int key){ - +/* if (key>=' '&&key<='~'){ banner.addGlyph(key); } @@ -286,7 +295,7 @@ void ofApp::keyReleased(int key){ banner.removeGlyph(); } ofLog()< laser_scale; 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