diff options
| -rw-r--r-- | freemium.pem | 23 | ||||
| -rw-r--r-- | menuApp/addons.make | 1 | ||||
| -rw-r--r-- | menuApp/src/ofApp.cpp | 109 | ||||
| -rw-r--r-- | menuApp/src/ofApp.h | 4 | ||||
| -rw-r--r-- | notes | 3 |
5 files changed, 44 insertions, 96 deletions
diff --git a/freemium.pem b/freemium.pem new file mode 100644 index 0000000..49057e8 --- /dev/null +++ b/freemium.pem @@ -0,0 +1,23 @@ +-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAnH/nHK4i2OTUfzP22GCcfeXtNPwS9jDWccSR2YO908mgmKd+aMOhx9fVUByi
+xlOsJpd27jtfjGk7LHyEXE5EREto1GBB3w1yKtIh44NuVLVKD5vQXTVYWn0xGzutubU9LUVuZL8o
+CHNoVvfIqf5G2ZmGdPeQSa9EO7+tF2b9gGc+5A3SkDYbsOksCTB4O5NUYhATV77PCurxSJ9mq+0o
+8HBU8ea2i+uHUrCU8xXXuK7rU2n8GQnwRkgsKBMM2ZMO74F8Cw4buarNPctBhaes4wST7kiZkQtp
+kcS0Tq65GN6eHeDuZ0HlMsIEw11bVdruQWTVf70ohsmFlSra2knBewIDAQABAoIBADuHh4DoWEcK
+nC4atR3PeheFu3o5HHlbUGcML7J+o1mJS7Zll/b/220qE3Eaw2wPbd9sJAgwu4KskJ62ap62As+7
+o4+NYeEXu0LAlbV2TCSapSZUzah23znkfyZtyAJpB3FOBNT7xZ2ZUKosLL9FAuxIstWRSehNa/YS
+TiQlv+30PBq+Ywc0yukEL9jX3lqlEG/O8EneIyBCZ9lROCbT45PF2RH9o2jKZedUzBlFOWnZYbGm
+1YjPtiSLpT+/1bPkBV4Gbv7tG+gij/G9vGfKpduzXl73vxf5whjuVr7lacd8l1snFu+Km4Zh6Soj
+234LcpTAJhLRsCcFgT79vGqnAeECgYEA+MneLIzgGPsuxw2r2wHPqCCDGe+1KGBpm534D/yzLe5D
+pQ2D4lUwpTWI9Mwp4HxSccP91U2nYa7ogcCBha6mKu8GAFeofcviTHUz3iM8NfgCra0koXpqyvLP
+bGHcfeT7qsN43K1gI12UU8WkRE34rQFdtEejHe3trc8vsRzXqmsCgYEAoQk0xm/cwujWNGtXhS4l
+R8tMIj0T0UyuQDeY5TWwxSExfqHykpbkd1vCOTP109ESM+I1ARRYSc5I+7DzeHxPsqh3pxBSUAZC
+lQK9GFedtxN/FG5yZOH9PIh21Gzlh8VGB3PZU7Lx0URzX09FLOe2DMsN+Ih127iqd0oat0vlKTEC
+gYEA9wbyDMhAh215D/qaJpaQyv6lTi5+cT3x/quGsNEYVMXc8tkNl8FA0PnsKC1Ec3reHcoekxpM
+1ahngtZThRpaMg0tp09ipK254HMLckkIMwo0FqDx20iDG0qm/JXa6kJgRTlcG7om2FbFvbxkE9Jb
+1eSiVyw+YaxqsIclcrYRyksCgYEAhQ5cQtHOsGU+CBXhPLOCLi31/BxHMZqQJ5NIi6qvIlJo2N7q
+1OBEabKxah5ased/iMsRTJEI2gLOHth4c0cTeuTj6G/98w0ZGpImt+Q89jXvvGv9rQlk+g0vUhmg
+FWyUjjfUi+nBEE3kng2bdJ0HuM5V/tKRvzh38RSTunvFHyECgYEA4co18EhSvvM8qvME6F8TbMRb
+BX/fcEhwHdyFFh9gWAQL9rX4tjYBMOBax+12woMJZH48LaLAXepjNij7UtztFHHRLC+C4BEWPZHA
+l6C08/uSO4yi4u0ZbOjpFfGlYfyhJtyvqrH2cFe1QkKoh85H4VqcsSLUG+yPqNofE8K9cqg=
+-----END RSA PRIVATE KEY-----
\ No newline at end of file diff --git a/menuApp/addons.make b/menuApp/addons.make index 5aa4842..3ce7b92 100644 --- a/menuApp/addons.make +++ b/menuApp/addons.make @@ -1,3 +1,4 @@ ofxInstagram ofxJSON ofxThreadedImageLoader +ofxTextSuite diff --git a/menuApp/src/ofApp.cpp b/menuApp/src/ofApp.cpp index b1da2ff..d65e7e2 100644 --- a/menuApp/src/ofApp.cpp +++ b/menuApp/src/ofApp.cpp @@ -14,6 +14,7 @@ void ofApp::loadimages(){ { for ( int i = 0; i < min(IMAGE_SLOTS,(int)instagram.getImageURL().size()); i++) { + //if (instagram.getImageURL()!=) getImages.loadFromURL(images[i], instagram.getImageURL()[i]); ofLog(OF_LOG_NOTICE) << instagram.getImageURL()[i]; //images[i].load("images/"+ofToString(i)+".jpg"); @@ -35,31 +36,12 @@ void ofApp::loadimages(){ void ofApp::setup(){ - ofTrueTypeFont::setGlobalDpi(180); - - type14.load("American Typewriter Regular.ttf", 14*FACTOR, true, true); - type14.setLineHeight(18.0f*FACTOR); - type14.setLetterSpacing(1.037*FACTOR); - - /* - bikers.load("images/bikers.jpg"); - gears.load("images/gears.gif"); - tdf.load("images/tdf_1972_poster.jpg"); - - tdfSmall.load("images/tdf_1972_poster.jpg"); - tdfSmall.resize(tdfSmall.getWidth() / 4, tdfSmall.getHeight() / 4); - tdfSmall.setImageType(OF_IMAGE_GRAYSCALE); - - transparency.load("images/transparency.png"); - bikeIcon.load("images/bike_icon.png"); - bikeIcon.setImageType(OF_IMAGE_GRAYSCALE); - */ - + ofTrueTypeFont::setGlobalDpi(150); + myText.init("American Typewriter Regular.ttf", 14*FACTOR, 'i'); background.load("images/background1080.png"); overlay.load("images/overlay1080.png"); - //overlay.setImageType(OF_IMAGE_GRAYSCALE); instagram.setup(hangdaitoken,"self"); instagram.setCertFileLocation(ofToDataPath("ca-bundle.crt",false)); @@ -78,6 +60,7 @@ void ofApp::setup(){ */ //load + ofSetFrameRate(5); } //-------------------------------------------------------------- @@ -88,23 +71,13 @@ void ofApp::update(){ //-------------------------------------------------------------- void ofApp::draw(){ - ofSetColor(255); + ofSetColor(255,255,255); ofPushMatrix(); //Store the coordinate system nexessary for some reason background.draw(0,0,ofGetWidth(),ofGetHeight()); ofPopMatrix(); //Restore the coordinate system - //ofLog(OF_LOG_NOTICE,"background is %fx%f",background.getWidth(),background.getHeight()); -/* - int rowinitialoffset=40; - int colinitialoffset=60; - int rowoffset=520; - int imgsize=480; - int coloffset=603; - int col=0; - int row=0; - int rows=2; -*/ + int colinitialoffset=40; int rowinitialoffset=60; int coloffset=520; @@ -113,9 +86,11 @@ ofPopMatrix(); //Restore the coordinate system int col=0; int row=0; int cols=2; - int textcolinset=40; + int textcolinset=20; int textrowinset=50; + + //some kind of rendering bug with textsuite means it has to go last or everything is dim if (!images.empty()) { for (int i = 0; i < images.size(); i++) { @@ -126,21 +101,11 @@ ofPopMatrix(); //Restore the coordinate system int imgy=(rowinitialoffset+(row*rowoffset))*FACTOR; images[i].draw(imgx,imgy,imgsize*FACTOR,imgsize*FACTOR); std::string caption=instagram.getImageCaption()[i]; - int captionend = caption.find("#"); - if (captionend == std::string::npos){ - captionend=caption.size(); - } - float width=type14.stringWidth(caption.substr(0,captionend)); - ofLog(OF_LOG_NOTICE) << caption.substr(0,captionend) << " <<<<:width: " << width; + myText.setText(caption); + myText.wrapTextX(imgsize*FACTOR); + myText.setColor(255,255,255,255); + myText.drawCenter(imgx+((imgsize*FACTOR)/2),imgy+((imgsize+textcolinset)*FACTOR),2); - vector<std::string> captions = ofSplitString(caption.substr(0,captionend), " "); - - if (width<imgsize){ - captions.push_back(caption.substr(0,captionend)); - } - - - type14.drawString(caption.substr(0,captionend),imgx+(textrowinset*FACTOR), imgy+((imgsize+textcolinset)*FACTOR)); } col++; if (col==cols){ @@ -150,56 +115,10 @@ ofPopMatrix(); //Restore the coordinate system } } - ofEnableAlphaBlending(); + ofEnableAlphaBlending(); overlay.draw(0,0,ofGetWidth(),ofGetHeight()); ofDisableAlphaBlending(); - - //captions[i]=getImageCaption()[i]; -/* - bikers.draw(0, 0); - gears.draw(600, 0); - tdf.draw(600, 300); - - ofSetColor(220, 50, 50); - tdfSmall.draw(200, 300); - - ofSetColor(255); - ofEnableAlphaBlending(); - float wave = sin(ofGetElapsedTimef()); - transparency.draw(500 + (wave * 100), 20); - ofDisableAlphaBlending(); - - // getting the ofColors from an image, - // using the brightness to draw circles - int w = bikeIcon.getWidth(); - int h = bikeIcon.getHeight(); - float diameter = 10; - ofSetColor(255, 0, 0); - for(int y = 0; y < h; y++) { - for(int x = 0; x < w; x++) { - ofColor cur = bikeIcon.getColor(x, y); - float size = 1 - (cur.getBrightness() / 255); - ofDrawCircle(x * diameter, 500 + y * diameter, 1 + size * diameter / 2); - } - } - - // same as above, but this time - // use the raw data directly with getPixels() - ofPixels & pixels = bikeIcon.getPixels(); - ofSetColor(0, 0, 255); - for(int y = 0; y < h; y++) { - for(int x = 0; x < w; x++) { - int index = y * w + x; - unsigned char cur = pixels[index]; - float size = 1 - ((float) cur / 255); - ofDrawCircle(200 + x * diameter, 500 + y * diameter, 1 + size * diameter / 2); - } - } - - ofSetColor(255); - bikeIcon.draw(190, 490, 20, 20); - */ } //-------------------------------------------------------------- diff --git a/menuApp/src/ofApp.h b/menuApp/src/ofApp.h index ceafb00..21d84de 100644 --- a/menuApp/src/ofApp.h +++ b/menuApp/src/ofApp.h @@ -3,6 +3,7 @@ #include "ofMain.h" #include "ofxInstagram.h" #include "ofxThreadedImageLoader.h" +#include "ofxTextSuite.h" #define IMAGE_SLOTS 5 #define FACTOR 0.9 @@ -38,5 +39,8 @@ class ofApp : public ofBaseApp{ ofTrueTypeFont type14; //ofImage images[5]; + + ofxTextBlock myText; + TextBlockAlignment alignment; //constants for controlling state }; @@ -2,4 +2,5 @@ token 3281768761.3dfcaf5.14ca9410c2aa4c00b9b60f36cd09d01a -testuncle44
\ No newline at end of file +testuncle44 +horseorchid44
\ No newline at end of file |
