/* // Ticker Developed for Motion Theory, 2004 Gabriel Dunne // gdunne@quilime.com // http://www.quilime.com // http://www.motiontheory.com */ BImage a; BFont monospace; int[][] aPixels; String fileName, frameNumber, sequenceExtension, sequencePrefix, targaSequencePrefix; int rowWidth, rowHeight, rowSpace, numberofRows, sequenceEndFrame, sequenceStartFrame, extCount; float minScrollSpeed, maxScrollSpeed; boolean isImageSequence, saveTargaSequence; color BGColor, tickerBGColor; TickerRow[] row; // setup void setup() { // settings ////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////// size(800, 200); // size = pixels in the image monospace = loadFont("SCREENFont-R.vlw"); // load font (must be a monospace to be authentic) fileName = "test.jpg"; // the image must be the exact pixel dimensions of the composition. if you are using an image sequence, this variable doesn't matter isImageSequence = false; // set if there is a sequence of images or not // the following must have 'isImageSequence' set to TRUE in order to be used by the applet sequencePrefix = "sequence_dir/sequence_"; // file name (do not include frame numbers) sequenceExtension = ".jpg"; // file extension sequenceStartFrame = 0; // first frame of the image sequence sequenceEndFrame = 97; // last frame of the image sequence saveTargaSequence = false; // change this to true if you want to save an image sequence targaSequencePrefix = "SEQUENCE_01-"; // SEQUENCE_01-###0.tga BGColor = color(0,0,0); // applet background color tickerBGColor = color(0,0,0); // ticker-row background color (this was set to black for production --the rows were extruded and textured in post. rowSpace = 0; // spacing between rows numberofRows = 20; // total number of rows minScrollSpeed = 1f; // minimum speed rows will be able to scroll maxScrollSpeed = 8f; // maximum speed rows will be able to scroll rowHeight = height/numberofRows; // height of each row (don't touch this variable for full screen) rowWidth = width; // width of each row (don't touch this variable for full screen) ////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////// noStroke(); noSmooth(); if (!isImageSequence) { updateImage(); } // if not an image sequence, update the pixel array once else { extCount = sequenceStartFrame; } // initialize each row row = new TickerRow[numberofRows]; for(int i=0; i < row.length; i++) { row[i] = new TickerRow(rowHeight*(i), rowWidth, rowHeight-rowSpace, random(minScrollSpeed, maxScrollSpeed)); } } // loop void loop() { background(BGColor); // redraw background if (isImageSequence) updateImage(); // if there is an image sequence, update the pixel array every frame for(int i=0; i < row.length; i++) row[i].scroll(); // draw rows if (saveTargaSequence) saveFrame(targaSequencePrefix + "-####.tga"); // save each frame } void updateImage() { if(extCount == sequenceEndFrame) extCount = sequenceStartFrame; // if extension is equal to the end of the sequence, restart at the beginning frameNumber = String(extCount); // adding the appropriate number of zeros if (frameNumber.length() == 1) frameNumber = "0000" + frameNumber; else if (frameNumber.length() == 2) frameNumber = "000" + frameNumber; else if (frameNumber.length() == 3) frameNumber = "00" + frameNumber; if (isImageSequence) fileName = sequencePrefix + frameNumber + sequenceExtension; a = loadImage(fileName); // Loads the image aPixels = new int[width][height]; // pixel array for(int i=0; i 0) { /* if (brightness(aPixels[x+j-2][y+tickerheight/2]) < 50 ) fill(random(0, 80)); else */ fill(aPixels[x+j-2][y+tickerheight/2]); // fill } if (count < curSymbolLength) { text(curSymbol.substring(count,count+1), x+j-2, y+tickerheight); count++; } else if (count == curSymbolLength) { //stroke(0,0,255); // will show the space //noFill(); //rect(x+j,y,20,30); count=0; keyNumber++; j+=tickerheight/2; // put two spaces arrayKey = orderlist[keyNumber]; } } } }