-
Notifications
You must be signed in to change notification settings - Fork 1
/
LayerGui.pde
177 lines (160 loc) · 4.59 KB
/
LayerGui.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
Group[] layerG;
Slider[] Layer_Timeline;
Textlabel[] Layer_Duration;
Toggle[] Layer_PlayPause;
Slider2D[] Layer_XY;
Slider[] Layer_Scale;
Slider[] Layer_Opacity;
Slider[] Layer_Delay;
Slider[] Layer_fadeInAlpha;
Slider[] Layer_fadeInDuration;
Slider[] Layer_fadeOutAlpha;
Slider[] Layer_fadeOutDuration;
Button[] Layer_Reset;
void initLayerGui(){
layerG = new Group[nbLayers];
Layer_Timeline = new Slider[nbLayers];
Layer_Duration = new Textlabel[nbLayers];
Layer_PlayPause = new Toggle[nbLayers];
Layer_XY = new Slider2D[nbLayers];
Layer_Scale = new Slider[nbLayers];
Layer_Opacity = new Slider[nbLayers];
Layer_Delay = new Slider[nbLayers];
Layer_fadeInAlpha = new Slider[nbLayers];
Layer_fadeInDuration = new Slider[nbLayers];
Layer_fadeOutAlpha = new Slider[nbLayers];
Layer_fadeOutDuration = new Slider[nbLayers];
Layer_Reset = new Button[nbLayers];
Group layerGui = gui.addGroup("Layer")
.setBackgroundColor(color(0))
.setPosition(505,310)
.setWidth(490)
.setBackgroundHeight(490)
.disableCollapse()
;
Accordion LayersGui = gui.addAccordion("LayersGui")
.setPosition(0,10)
.setWidth(490)
.setCollapseMode(Accordion.SINGLE)
.moveTo(layerGui)
;
// Accoordion's content
for (int n = nbLayers-1; n>=0; n--){
layerG[n] = gui.addGroup("Layer"+n)
.setWidth(490)
.setBackgroundHeight(390)
.activateEvent(true)
;
Layer_Timeline[n] = gui.addSlider("Layer_Timeline"+n)
.setPosition(10,10)
.setSize(470,10)
.setRange(0,1)
.setId(0)
.moveTo(layerG[n])
;
Layer_Timeline[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_Duration[n] = gui.addTextlabel("Layer_Duration"+n)
.setText("DURATION: 0.00")
.setPosition(380,23)
.moveTo(layerG[n])
.setId(1)
;
Layer_PlayPause[n] = gui.addToggle("Layer_PlayPause"+n)
.setPosition(10,40)
.setSize(80,10)
.moveTo(layerG[n])
.setId(2)
;
Layer_XY[n] = gui.addSlider2D("Layer_XY"+n)
.setPosition(10,130)
.setSize(260,140)
.setMinX(-100)
.setMaxX(100)
.setMinY(-100)
.setMaxY(100)
.setArrayValue(new float[] {100,100})
.setId(3)
.moveTo(layerG[n])
;
Layer_Scale[n] = gui.addSlider("Layer_Scale"+n)
.setPosition(295,130)
.setSize(185,10)
.setMin(0.1)
.setMax(10)
.setValue(1)
.setId(4)
.moveTo(layerG[n])
;
Layer_Scale[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_Opacity[n] = gui.addSlider("Layer_Opacity"+n)
.setPosition(295,180)
.setSize(185,10)
.setMin(0.0)
.setMax(1.0)
.setValue(1.0)
.setId(5)
.moveTo(layerG[n])
;
Layer_Opacity[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_Delay[n] = gui.addSlider("Layer_Delay"+n)
.setPosition(295,220)
.setSize(185,10)
.setMin(0.0)
.setMax(600.0)
.setValue(0.0)
.setId(6)
.moveTo(layerG[n])
;
Layer_Delay[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_fadeInAlpha[n] = gui.addSlider("Layer_fadeInAlpha"+n)
.setPosition(10,300)
.setSize(185,10)
.setMin(0.0)
.setMax(1.0)
.setValue(1.0)
.setId(7)
.moveTo(layerG[n])
;
Layer_fadeInAlpha[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_fadeInDuration[n] = gui.addSlider("Layer_fadeInDuration"+n)
.setPosition(10,330)
.setSize(185,10)
.setMin(0.0)
.setMax(20.0)
.setValue(0.0)
.setId(8)
.moveTo(layerG[n])
;
Layer_fadeInDuration[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_fadeOutAlpha[n] = gui.addSlider("Layer_fadeOutAlpha"+n)
.setPosition(240,300)
.setSize(185,10)
.setMin(0.0)
.setMax(1.0)
.setValue(1.0)
.setId(9)
.moveTo(layerG[n])
;
Layer_fadeOutAlpha[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_fadeOutDuration[n] = gui.addSlider("Layer_fadeOutDuration"+n)
.setPosition(240,330)
.setSize(185,10)
.setMin(0.0)
.setMax(20.0)
.setValue(0.0)
.setId(10)
.moveTo(layerG[n])
;
Layer_fadeOutDuration[n].getCaptionLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
Layer_Reset[n] = gui.addButton("Layer_Reset"+n)
.setPosition(400,40)
.setSize(80,10)
.setId(11)
.moveTo(layerG[n])
;
Layer_Reset[n].getCaptionLabel().align(ControlP5.RIGHT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0);
// add to accordion
LayersGui.addItem(layerG[n]);
}
LayersGui.open(7);
}