Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //import controlP5.*;
- //ControlP5 cp5;
- // INTENTAR HACER TODO LO MENOS HARDCODED POSIBLE
- //AGREGAR UN IF QUE CHEQUEE EN QUE MES ESTAMOS Y EN BASE A ESO DAR LA CANTIDAD DE DIAS
- int cantidad_dias = 31;
- int columnas_filas = 8;
- int dia = 0;
- int espaciado = 60;
- BotonDia[] dias = new BotonDia[cantidad_dias];
- void setup() {
- background(0);
- float x = 0;
- float y = 0;
- size(1280, 720);
- for (int i = 0; i < 8; i++) {
- strokeWeight(5);
- stroke(255);
- line(x, 0, x, 420);
- line(0, y, 420, y);
- x = x + espaciado;
- y = y + espaciado;
- }
- for (int fila = 2; fila < 8; fila++) {
- for (int columna = 1; columna < 8; columna++) {
- dias[dia] = new BotonDia(fila, columna, dia);
- //CHEQUEO DE QUE LOS DIAS ESTEN EN LA COLUMNA Y FILA CORRESPONDIENTE
- println("dia: ", dia+1);
- println("f: ", fila);
- println("c: ", columna);
- if (dia!=30) {
- dia = dia + 1;
- } else {
- break;
- }
- }
- if (dia==30) {
- break;
- }
- }
- for (int i = 0; i <31; i++) {
- dias[i].mostrar_numero();
- }
- //cp5 = new ControlP5(this);
- }
- void draw() {
- }
- //OBJETO FECHA
- class BotonDia {
- int columna;
- int fila;
- int dia;
- BotonDia(int filaTemp, int columnaTemp, int diaTemp) {
- fila = filaTemp;
- columna = columnaTemp;
- dia = diaTemp+1;
- }
- void mostrar_numero() {
- colorMode(HSB, 255);
- fill(35, 255, 255);
- textSize(20);
- text(dia, columna*espaciado-35, fila*espaciado-35);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement