Skip to content

Commit b76c36a

Browse files
committed
added WatchFace example
1 parent e8fd81c commit b76c36a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
float angle = 0;
2+
3+
void setup() {
4+
fullScreen(P2D);
5+
frameRate(15);
6+
}
7+
8+
void draw() {
9+
translate(0, +insetBottom/2);
10+
11+
if (ambientMode) {
12+
background(0);
13+
stroke(255);
14+
noFill();
15+
} else {
16+
background(157);
17+
stroke(0);
18+
fill(255);
19+
}
20+
21+
line(0, 0, width, height);
22+
line(width, 0, 0, height);
23+
24+
translate(width/2, height/2);
25+
rotate(angle);
26+
rect(-50, -50, 100, 100);
27+
angle += 0.01;
28+
}

0 commit comments

Comments
 (0)