We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hii I was a novice programmer. i am from indonesia and I am very interested in the programming language processing.
I've watched several videos Daniel Shiffman about how to create a class, function, rect, circle, etc. but still not all that I have seen.
I am trying to create a function which can create a box shape as in potoshop
This is the result of my work
I may look fail :'( but I hope you can teach me how to write the code.
thx.... i am sorry if my english so bad
Answers
https://processing.org/reference/constrain_.html
constrain(number, low, high);
Your code:
float mx = constrain(mouseX, mouseX, 200);
Because number == low, then mx == mouseX.
This means:
rect(mouseX, mouseY, mouseX, mouseY);
That is a rectangle less than one pixel...