Simulation von Bürgern
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Util.pde 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. class iPVector {
  2. int x, y, z;
  3. iPVector(int getx, int gety) {
  4. x = getx;
  5. y = gety;
  6. }
  7. iPVector(int getx, int gety, int getz) {
  8. x = getx;
  9. y = gety;
  10. z = getz;
  11. }
  12. }
  13. void pre() {
  14. //window resize event
  15. if (i_windowW != width || i_windowH != height) {
  16. i_windowW = width;
  17. i_windowH = height;
  18. i_uiY = i_windowH - i_uiH;
  19. i_uiW = i_windowW;
  20. i_uiH = i_windowH - i_uiY;
  21. buttons[0].i_x = i_windowW/2-buttons[0].i_w/2;
  22. buttons[0].setLabel(buttons[0].s_label);
  23. f_timeBoxCenterX = i_windowW/2;
  24. f_timeBoxCenterX = i_windowW/2;
  25. f_timeBoxX = f_timeBoxCenterX-f_timeBoxW / 2;
  26. i_iconX = int(1.2*i_windowW/20);
  27. i_iconY = 10+i_windowW/40;
  28. i_iconW = i_windowW/20;
  29. i_iconH = i_windowW/20;
  30. i_iconCorner = i_windowW/40;
  31. for (int i = 1; i < 6; i++) {
  32. buttons[i].i_y = i_iconY-i_iconH/2;
  33. buttons[i].i_w = i_iconW;
  34. buttons[i].i_h = i_iconH;
  35. buttons[i].i_corner = i_iconCorner;
  36. }
  37. buttons[1].i_x = i_iconX-i_iconW/2;
  38. buttons[2].i_x = 2*i_iconX-i_iconW/2;
  39. buttons[3].i_x = 2*i_iconX-i_iconW/2;
  40. buttons[4].i_x = 3*i_iconX-i_iconW/2;
  41. buttons[5].i_x = 3*i_iconX-i_iconW/2;
  42. }
  43. }