new map, debug system

This commit is contained in:
2019-01-15 02:36:01 +01:00
parent e0db5a1081
commit e9e4d886ef
5 changed files with 71 additions and 30 deletions

41
UI.pde
View File

@@ -1,6 +1,8 @@
int i_uiTransparency = 200;
void initUI() {
i_uiX = 0;
i_uiY = 420;
i_uiY = 520;
i_uiW = width;
i_uiH = height - i_uiY;
}
@@ -11,17 +13,44 @@ void drawUI() {
strokeWeight(1);
line(i_uiX, i_uiY, i_uiX+i_uiW, i_uiY);
strokeWeight(0);
fill(255, 230);
fill(255, i_uiTransparency);
rect(i_uiX, i_uiY, i_uiW, i_uiH);
rect(6, 4, 140, 31, 6);
fill(0);
textSize(30);
textAlign(LEFT);
text(String.format("%02d", hour()) + ":" + String.format("%02d", minute()) + ":" + String.format("%02d", second()), 10, 30);
textSize(15);
text("FPS: " + int(frameRate), 10, i_uiY + 15);
String[] debug = {
"FPS: " + int(frameRate),
" ",
"Selected Citizen ID: " + i_selectedCitizen,
"Name: " + citizen[i_selectedCitizen].S_name,
"x: " + citizen[i_selectedCitizen].f_xPos + " y: " + citizen[i_selectedCitizen].f_yPos,
"Movement speed: " + citizen[i_selectedCitizen].f_movementSpeed,
"Velocity: ",
"Outside",
"Mood: "
};
int ts = i_debugTextSize;
textSize(ts);
int line = 0;
int maxLinesPerColumn = i_uiH/ts;
if (maxLinesPerColumn > 0) {
int requiredColumns = (debug.length/maxLinesPerColumn)+1;
for (int i = 0; i < requiredColumns; i++) {
while (((line-(maxLinesPerColumn*i)) * ts + ts)+i_uiY<height && line < debug.length) {
text(debug[line], 10+(150*i), i_uiY+(ts*((line-(maxLinesPerColumn*i))+1)));
line++;
}
}
//text("FPS: " + int(frameRate), 10, i_uiY + 15);
//text("Selected Citizen: " + i_selectedCitizen, 10, i_uiY + 30);
}
}
boolean b_mouseChangeMapOffset, b_mouseChangeUiHeight;