We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I usually use:
if(mouseX >= rectx && mouseX <= rectx + rectwidth && mouseY >= recty && mouseY <= recty + rectheight)
to use functions when clicked on rectangle areas.
What is the if-condition to cover the area of a rect with rounded edges?
Answers
I assume you mean rounded corners :)
There is no simple
if
statement that you could use for rectangles with rounded corners if you want an accurate test.If the rounded corners were visually small then you could simply ignore them.
You could additionally to the standard if-clause check color with get
I think i will simply ignore it then. Was a bit unsecure if someone could see a problem with that using a touch field on a laptop :s