done renaming
This commit is contained in:
23
Lektion 1/Systemvariablen/Zaehler/Zaehler.pde
Normal file
23
Lektion 1/Systemvariablen/Zaehler/Zaehler.pde
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user