-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraw.pde
64 lines (59 loc) · 1.47 KB
/
draw.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
void draw()
{
if (isConfiguring)
{
ArrayList<String> names;
background(78, 93, 75);
//based on last key pressed lets display
// appropriately
if (key == 'i')
info = getBluetoothInformation();
else
{
if (key == 'p')
{
info = "Paired Devices:\n";
names = bt.getPairedDeviceNames();
} else
{
info = "Discovered Devices:\n";
names = bt.getDiscoveredDeviceNames();
}
for (int i=0; i < names.size(); i++)
{
info += "["+i+"] "+names.get(i).toString() + "\n";
}
}
text(UIText + "\n\n" + info, 5, 90*displayDensity);
} else
{
background(78, 93, 75);
pushStyle();
fill(255);
ellipse(mouseX, mouseY, 20, 20);
fill(0, 255, 0);
stroke(0, 255, 0);
//ellipse(remoteMouse.x, remoteMouse.y, 20, 20);
fill(0);
if(otherSize.size() > 0){
ellipse(remoteMouse.x/ratio.get(0), remoteMouse.y/ratio.get(1), 20, 20);
//ratio adjustment
/*x to width
if(ratio.get(0)*width > otherSize.get(0)){
ratio.set(0, ratio.get(0) - 0.1);
}
else if(ratio.get(0)*width < otherSize.get(0)){
ratio.set(0, ratio.get(0) + 0.1);
}
//y to height
if(ratio.get(1)*height > otherSize.get(1)){
ratio.set(1, ratio.get(1) - 0.1);
}
else if(ratio.get(1)*height < otherSize.get(1)){
ratio.set(1, ratio.get(1) + 0.1);
}*/
}
popStyle();
}
drawUI();
}