rectMode for only 1 rect

Hey,
i am new in Processing and i have a question…
i want to center 1 rect but the function rectMode centers all rects how can i change this?

Welcome, @Sander

How about if you switch the mode, draw a rectangle, then switch back?

rectMode(CENTER);
rect(...);
rectMode(CORNER);
rect(...);
3 Likes

it works, thanks for the answer and i am sorry…
i am new :smile:

In case you have a bunch of rect() commands it’s worth using pushStyle() before rectMode(); and then once finished call popStyle() to get rectMode() (or other used styles) back to its previous style:

1 Like