-
Notifications
You must be signed in to change notification settings - Fork 0
/
Film.pde
53 lines (43 loc) · 1.04 KB
/
Film.pde
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class Film {
String name;
int yr;
int[] rankings = new int[2]; // only two years worth of data
int ranking_07;
int ranking_98;
float targX, x, targY, y, targW, w;
void update() {
x += (targX - x) * .05;
y += (targY - y) * .03;
w += (targW - w) * .105;
}
void render() {
pushMatrix();
translate(x, y);
// rotate(-PI/2);
fill(0, 0, 0, 155);
stroke(255, 255, 255, 200);
ellipse(0, 0, w, w);
targW = 8;
fill(0, 0, 0, 5);
if ( dist(mouseX, mouseY, x, y) < 15 ) {
pushMatrix();
translate(0, 0, 1);
targW = 25;
fill(255, 255, 255, 19);
//stroke(0);
rect(15, -30, 250, 60);
fill(70);
noStroke();
textFont(yearLabel);
text(yr + ", #" + rankings[currRankYear], 15, 18); // bug: needs a ref to the current metric eg. current_Ranking, or just ranking
fill(0);
textFont(filmName);
text(name, 15, 0 );
popMatrix();
} else {
textFont(filmName);
text(name, 15, 0 );
}
popMatrix();
}
}