We are about to switch to a new forum software. Until then we have removed the registration on this forum.
void setup() {
size(400, 400);
textSize(64);
textAlign(CENTER, CENTER);
fill(255);
}
void draw() {
background(90);
object();
}
void object () {
if (blink(30)) {
text("LED", width/2, height/2);
}
}
boolean blink(int span) {
return frameCount%(span*2) < span;
}
Answers
Basically I want to put a timer that stops the "blinking" effect after a few seconds
One variable
int startTime
is defined beforesetup()
and set at the end ofsetup()
tomillis()
in draw say in line 10
Which would deliver true for 3 seconds
@Chrisir Thanks man, its exactly what I need.