Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. //import controlP5.*;
  2. //ControlP5 cp5;
  3.  
  4. // INTENTAR HACER TODO LO MENOS HARDCODED POSIBLE
  5. //AGREGAR UN IF QUE CHEQUEE EN QUE MES ESTAMOS Y EN BASE A ESO DAR LA CANTIDAD DE DIAS
  6. int cantidad_dias = 31;
  7. int columnas_filas = 8;
  8. int dia = 0;
  9. int espaciado = 60;
  10. BotonDia[] dias = new BotonDia[cantidad_dias];
  11. void setup() {
  12. background(0);
  13.  
  14. float x = 0;
  15. float y = 0;
  16. size(1280, 720);
  17.  
  18. for (int i = 0; i < 8; i++) {
  19. strokeWeight(5);
  20. stroke(255);
  21. line(x, 0, x, 420);
  22. line(0, y, 420, y);
  23. x = x + espaciado;
  24. y = y + espaciado;
  25. }
  26. for (int fila = 2; fila < 8; fila++) {
  27.  
  28. for (int columna = 1; columna < 8; columna++) {
  29. dias[dia] = new BotonDia(fila, columna, dia);
  30. //CHEQUEO DE QUE LOS DIAS ESTEN EN LA COLUMNA Y FILA CORRESPONDIENTE
  31. println("dia: ", dia+1);
  32. println("f: ", fila);
  33. println("c: ", columna);
  34. if (dia!=30) {
  35. dia = dia + 1;
  36. } else {
  37. break;
  38. }
  39. }
  40. if (dia==30) {
  41. break;
  42. }
  43. }
  44. for (int i = 0; i <31; i++) {
  45. dias[i].mostrar_numero();
  46. }
  47.  
  48.  
  49. //cp5 = new ControlP5(this);
  50. }
  51.  
  52.  
  53.  
  54. void draw() {
  55. }
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. //OBJETO FECHA
  68. class BotonDia {
  69. int columna;
  70. int fila;
  71. int dia;
  72.  
  73. BotonDia(int filaTemp, int columnaTemp, int diaTemp) {
  74. fila = filaTemp;
  75. columna = columnaTemp;
  76. dia = diaTemp+1;
  77. }
  78. void mostrar_numero() {
  79. colorMode(HSB, 255);
  80. fill(35, 255, 255);
  81. textSize(20);
  82. text(dia, columna*espaciado-35, fila*espaciado-35);
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement