Blinking text over Video (GSVIDEO)
in
Contributed Library Questions
•
2 years ago
Hi ho,
can someone explain, how to make a blinking text over a playing video?
This is my try, but the text is flickering:
import codeanticode.gsvideo.*;
GSMovie movie;
int newFrame = 0;
PFont font;
boolean on = true;
void setup() {
size(320, 240);
background(0);
movie = new GSMovie(this, "station.mov");
movie.loop();
font = loadFont("DejaVuSans-24.vlw");
textFont(font, 30);
}
void movieEvent(GSMovie movie) {
movie.read();
}
void draw() {
image(movie, 0, 0, width, height);
if (frameCount % 100 < 50) {
if (on) {
fill(255);
textAlign(CENTER);
text("YOU WIN!", width/2, height/2);
}
on = !on;
}
}
1