We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I was just trying to create a square that followed the mouse about, but as Y increases the shape gets taller and as x increases is gets wider
I'm expecting the bottom right of the shape to remain 100 pts (units, pixels?) away from the top left, but this isn't what's happening and I'm not too sure why.
Here's the code :
void setup() {
size(500, 500);
strokeWeight(7);
}
void draw() {
background(255);
rect(mouseX, mouseY, mouseX + 100, mouseY + 100);
}
Answers
the 3rd & 4th value is width and height and not an absolute position (like parameter 1 & 2 are)
so write
;-)
Oh right, they're relative to the first two... Dunno where I got that idea from but I was fairly set on it for some reason
thanks!
you can change the behaviour with rectMode (if you enjoy the extra typing)
https://processing.org/reference/rectMode_.html
http://studio.processingtogether.com/sp/pad/export/ro.9PDcp7xMBknWz/latest
cheers all
@GoToLoop (not sure if you get a flag if I do that or not... ) -> nice, wasn't aware of that online thing!