2023-09-25 18:56:08 +02:00

24 lines
425 B
Plaintext

void setup()
{
size(800, 600);
frameRate(60);
}
float second;
float offset = 0;
void draw()
{
background(40, 40, 40, 256);
//fill(0,0,0,1);
second = constrain(((float) frameCount / (float) frameRate) - offset, 0 , 1000);
if(mousePressed == true)
{
offset = second + offset ;
}
println(offset + " " + mousePressed);
textSize(50);
text(second, width / 2 -50, height/2);
}