|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.ObjectcontrolP5.ControlTimer
public class ControlTimer
control timer is a timer that can be used for example as a stop watch or a duration timer.
/**
* ControlP5 Timer
* by andreas schlegel, 2009
*/
import controlP5.*;
ControlP5 cp5;
ControlTimer c;
Textlabel t;
void setup() {
size(400,400);
frameRate(30);
cp5 = new ControlP5(this);
c = new ControlTimer();
t = new Textlabel(cp5,"--",100,100);
c.setSpeedOfTime(1);
}
void draw() {
background(0);
t.setValue(c.toString());
t.draw(this);
t.setPosition(mouseX, mouseY);
}
void mousePressed() {
c.reset();
}
| Constructor Summary | |
|---|---|
ControlTimer()
create a new control timer, a timer that counts up in time. |
|
| Method Summary | |
|---|---|
int |
day()
day position of the timer. |
int |
hour()
Hour position of the timer in international format (0-23). |
int |
millis()
Get the milliseconds of the timer. |
int |
minute()
Minutes position of the timer. |
void |
reset()
reset the timer. |
int |
second()
Seconds position of the timer. |
void |
setSpeedOfTime(float theSpeed)
set the speed of time, for slow motion or high speed. |
long |
time()
get the time in milliseconds since the timer was started. |
java.lang.String |
toString()
return a string representation of the current status of the timer. |
void |
update()
called to update the timer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ControlTimer()
| Method Detail |
|---|
public int day()
public int hour()
public int millis()
public int minute()
public void reset()
public int second()
public void setSpeedOfTime(float theSpeed)
theSpeed - intpublic long time()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||