-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDEV_GUI.pde
More file actions
133 lines (107 loc) · 4.48 KB
/
DEV_GUI.pde
File metadata and controls
133 lines (107 loc) · 4.48 KB
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
/*----------------------------------------------------------title
------ Developer Console -------
-----------------------------------------------------------------
------ Classes, Calcs, Setups -------
---------------------------------------------------------------*/
/*----------------------------------------------------------class
------ Developer Console -------
---------------------------------------------------------------*/
void set_devcon_visible() {
/*if (key == 'f') {
if (DEF_dev_gui) {
DEF_dev_gui = false;
} else {
DEF_dev_gui = true;
}
}*/
}
// Function checking of button pressed "f"
void update_devcon() {
// Is Alredy Showed
set_devcon_visible();
if (DEF_dev_gui) {
/*---------- TEXT INFO ----------*/
// Set text align to RIGHT, cause positions
textAlign(RIGHT);
textSize(12);
fill(255);
// Create text with: (name, version, framerate)
text("the SPACER v1.0.1 ( "+round(frameRate)+" FPS )", width-5, 20);
// Create text with: (Current screen, current Layout of screen)
text(" ("+DEF_actualLayout+" )", width-5, 40);
// Create text with: (Current time [Hh,Mm,Ss])
text(hour()+"h, "+minute()+"m, "+second()+"s", width-5, 60);
// Create text with: Dimensions of actual Displayed Frame
text((""+width+"x"+height), width-5, 80);
// Create text with: Actual MousePoint position (X [Width],Y [Height])
text(("X: "+mouseX+", Y: "+mouseY), width-5, 100);
//if (currObject != null) {
// text("Mouse is over: "+currObject+"", width-5, height-5);
//}
// Create text with: Actual number of second (Program running Seconds)
text("started before: "+(millis()/1000)+"s", width-5, height-25);
textAlign(LEFT);
/*
if (mousePressed) {
if (firstpoint) {
savePointX = mouseX;
savePointY = mouseY;
tempObject = currObject;
firstpoint = false;
}
if (savePointX != mouseX || savePointY != mouseY) {
dragging = true;
stroke(255, 165, 0);
line(savePointX, savePointY, mouseX, mouseY);
fill(255, 165, 0);
if (tempObject != null) {
text("Dragging ("+tempObject+") from [X: "+savePointX+", Y: "+savePointY+"] with distance ("+round(dist(mouseX, mouseY, savePointX, savePointY))+"px)", 5, height-5);
} else {
text("Dragging from [X: "+savePointX+", Y: "+savePointY+"] with distance ("+round(dist(mouseX, mouseY, savePointX, savePointY))+"px)", 5, height-5);
}
} else {
fill(0, 255, 0);
if (currObject != null) {
text("Pressed ("+tempObject+") on [X: "+mouseX+", Y: "+mouseY+"] ", 5, height-5);
} else {
text("Pressed on [X: "+mouseX+", Y: "+mouseY+"]", 5, height-5);
}
dropped = false;
dragging = false;
}
} else {
if (dropped) {
fill(255);
if (tempObject == null) {
text("Dropped to [X: "+dropX+", Y: "+dropY+"] from [X: "+savePointX+", Y: "+savePointY+"] with distance ("+round(dist(dropX, dropY, savePointX, savePointY))+"px)", 5, height-5);
} else {
if (tempObject == null) {
text("Dropped to ("+tempObject+") to [X: "+dropX+", Y: "+dropY+"] from [X: "+savePointX+", Y: "+savePointY+"] with distance ("+round(dist(dropX, dropY, savePointX, savePointY))+"px)", 5, height-5);
} else {
text("Dropped ("+tempObject+") to [X: "+dropX+", Y: "+dropY+"] from [X: "+savePointX+", Y: "+savePointY+"] with distance ("+round(dist(dropX, dropY, savePointX, savePointY))+"px)", 5, height-5);
}
}
}
}
*/
fill(255);
/*---------- GRAPHIC INFO ----------*/
// Set stroke color to RED (255,0,0)
stroke(255, 0, 0, 50);
// Create VERTICAL Line which is crossing the mouse positions
line(mouseX, height, mouseX, 0);
// Set stroke color to BLUE (0,0,255)
stroke(0, 0, 255, 50);
// Create HORIZONTAL Line which is crossing the mouse positions
line(width, mouseY, 0, mouseY);
// Set cursor type to CROSS, for better look
cursor(CROSS);
// Set stroke back cause other objects
noStroke();
// Set text align back to LEFT, case positions
textAlign(LEFT);
} else {
// Set cursor type back to Default
cursor(ARROW);
}
}