-
Notifications
You must be signed in to change notification settings - Fork 1
/
LayoutWithFixedDisplaySet.pde
66 lines (48 loc) · 1.85 KB
/
LayoutWithFixedDisplaySet.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//extends LayoutAllInOut so that there's a fixed set of displays that shows by default
//with one display from the constructor to take turn
class LayoutWithFixedDisplaySet extends LayoutAllInOne {
List<DisplayInterface> fixedDisplays;
LFO lfoCtrlA1, lfoCtrlA2;
LayoutWithFixedDisplaySet(ARect bound, List<DisplayInterface> displays) {
super(bound, displays);
super.maxDisplays = 1;
super.useFullAlphaLayerMode = false;
lfoCtrlA1 = new LFO(LFO.SHAPE_SINE, random(0,1), 0.26/ frameRate);
lfoCtrlA2 = new LFO(LFO.SHAPE_SINE, random(0,1), 4.6/ frameRate);
fixedDisplays = new ArrayList();
fixedDisplays.add(new DisplayGridMove(bound));
fixedDisplays.add(new DisplayRulers(bound));
fixedDisplays.add(new DisplayStarZoom(bound));
fixedDisplays.add(new DisplaySourceCode(bound));
fixedDisplays.add(new DisplayWalkingTiles(bound));
int titleWidth = 250, titleHeight = 33, titleMargin = 30;
ARect titleBound = new ARect(bound.width - titleWidth - titleMargin, bound.height - titleHeight - titleMargin, titleWidth, titleHeight);
DisplayTitle dtitle = new DisplayTitle(bound, titleBound, "Norsez - Volume of the Ocean");
layout = new LayoutAllInOne(bound, displays);
fixedDisplays.add(dtitle);
fixedDisplays.add(new DisplaySubWindows(bound));
}
void draw(PGraphics g) {
super.draw(g);
g.push();
g.tint(255,200);
for(DisplayInterface d: this.fixedDisplays) {
d.draw(g);
}
g.pop();
lfoCtrlA1.nextValue();
lfoCtrlA2.nextValue();
updateParameters();
}
void updateParameters () {
if(frameCount % APP_PARAM_UPDATE_RATE != 0) return;
controlA = abs((lfoCtrlA1.currentValue + lfoCtrlA2.currentValue) * 4);
}
void bang() {
super.bang();
for(DisplayInterface d: fixedDisplays) {
d.bang();
}
super.fullAlphaLayer = 0;
}
}