We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone,
I'm trying unsuccessfully to build a prototype of resizeable box. As a first step I'd like to be able to drag the bottom right corner to have a bigger box. The dragging part of the code is working but I am not able to leave the bigger box on the screen when I release the mouse button. Here's the code:
void setup(){
size(800,500);
strokeWeight(4);
stroke(0);
smooth();
}
void draw(){
background(0);
if(mousePressed && mouseX > 200 && mouseY > 200){
rect(100,100,mouseX-100,mouseY-100);
} else {
rect(100,100,100,100);
}
}
Thanks in advance for any help.
Luca
Answers
upper left corner: drag the box around
Lower right corner: resize
;-)
this is incredible, thank you Chrisir! fast and perfect :)>- . Now I go to study the code...
great!