Created
May 20, 2014 22:38
-
-
Save jacobjoaquin/a11d7ef65c0f6aec790b to your computer and use it in GitHub Desktop.
A quick mockup to see if LED strips aligned at an angle could produce readable scrolling type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PGraphics theMask; | |
PImage imageMask; | |
String s = "Fresno Ideaworks LED Panel Test"; | |
int xOffset; | |
int xInc = 200 / 11; | |
void generateMask() { | |
theMask = createGraphics(width, height); | |
theMask.beginDraw(); | |
theMask.stroke(255); | |
theMask.strokeWeight(1); | |
for (int i = -80; i < width + 100; i += xInc) { | |
theMask.line(i, 0, i - (xInc * 4), height); | |
} | |
theMask.endDraw(); | |
imageMask = createImage(width, height, ALPHA); | |
imageMask.copy(theMask, 0, 0, width, height, 0, 0, width, height); | |
} | |
void setup() { | |
size(300, 100); | |
generateMask(); | |
smooth(); | |
xOffset = width; | |
rectMode(CENTER); | |
} | |
void draw() { | |
background(0); | |
PGraphics visual = createGraphics(width, height); | |
visual.beginDraw(); | |
visual.textSize(height + 30); | |
visual.textAlign(LEFT, CENTER); | |
visual.text(s, xOffset, height / 2 - 15); | |
visual.endDraw(); | |
xOffset = xOffset - 2; | |
if (xOffset < -2000) { | |
xOffset = width; | |
} | |
imageMask.mask(visual); | |
image(imageMask, 0, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment