-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindow.pde
49 lines (37 loc) · 1.09 KB
/
Window.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
abstract class Window extends DynamicFrame implements ButtonListener{
ArrayList bHolder;
ArrayList mHolder;
Styles st;
Window(PVector aPos, PVector aSize, UISceneElement aParent){
super(aPos, aSize, aParent);
bHolder = new ArrayList();
mHolder = new ArrayList();
st = new Styles();
}
void renderElement(){
super.renderElement();
PVector p = getCurrentPos();
PVector s = getCurrentSize();
// render chrome
fill(100, 100, 100, 100); // color for the chrome in the borders
st.roundRect((int)p.x, (int)p.y, (int)s.x, (int)s.y, 10);
}
boolean isOver(TuioCursor tcur){
PVector p = getCurrentPos();
PVector s = getCurrentSize();
return Collision.hitQuad(p, s, new PVector(tcur.getScreenX(width), tcur.getScreenY(height)));
}
protected void addControlButton(Button aButton){
aButton.addListener(this);
bHolder.add(aButton);
}
protected void addMenu(Menu menu){
mHolder.add(menu);
}
ArrayList getElementRArray(){
return bHolder;
}
ArrayList getMenuStructure() {
return mHolder;
}
}