-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDriver.java
More file actions
32 lines (30 loc) · 780 Bytes
/
Driver.java
File metadata and controls
32 lines (30 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This is a sample of how it can be used
public class Driver {
public static void main(String[] args) {
ClockTest c = new ClockTest();
}
}
class ClockTest extends JGameEngine {
public ClockTest() {
this.setWindow("JGameEngine test");
this.addObject(new dummyClock(this));
}
}
class dummyClock extends JGameEngine.Object {
JGameEngine e;
public dummyClock(JGameEngine e) {
this.e = e;
}
@Override
public void update() {
String time = String.valueOf(System.currentTimeMillis());
// Set font
e.textSize(64);
// Write text at the center of window
e.drawText( time,
e.cameraWidth() / 2 - e.textWidth(time) / 2,
e.cameraHeight() / 2);
}
@Override
public void start() { }
}