Paula Nicole Castillo: 4to Proyecto - Pizarra de dibujo

De Casiopea
Pizarra de dibujo


TítuloPizarra de dibujo
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 4
Período2012-
AsignaturaTaller Inicial Común 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
CarrerasDiseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
Alumno(s)Paula Nicole Castillo
ProfesorHerbert Spencer

//*Con ejemplo de pizarra en clase, se crea una pizarra de dibujo del tamaño de la pantalla con funcion de:

botón izquierto(mouse): dibuja botón derecho(mouse): borra tecla 3: se resetea tecla d: cambia de color aleatoriamente *//


 
void setup() {
  size(screen.width, screen.height); // Tamano pizarra  `
  background(255);
  smooth(); // Suavizado anti-aliasing
  stroke(3);
  strokeWeight(2);
  colorMode(HSB); //Establezco el formato de color
}

void draw() {
  if (mousePressed) {
    if (mouseButton == LEFT) { // Dibuja
      line(mouseX, mouseY, pmouseX, pmouseY);
    }
  }
  if (mousePressed) {
    if (mouseButton == RIGHT) { //Borra
      line(mouseX, mouseY, pmouseX, pmouseY);
      stroke(255);
      strokeWeight (10);
    }
  }
  if (keyPressed)
    if (key == 'd'){ // Cambia el color al azar
    stroke (random(255), 255, 255);
    }
    
    if (keyPressed) {
    if (key == '3') {
      background(255); // resetea
    }
  }
}