I just updated my processing to 3.5 and I saw that they added circle () and square()
Does anyone know the syntax and parameters of these functions? I think it’s exciting to have these new features.
circle(int x, int y, int diameter);
prints a circle at location x
, y
with a diameter of diameter
square(int x, int y, int wh);
prints a square at location x
, y
with a width and height of wh
By the way, did you know that processing has code suggestions if you enable them in preferences and press ctrl+space while typing? It’s very useful.
The actual documentation will probably be updated within a day or so.
you see this already?
and pls. use
processing 3.5.1
Radius? Function ellipse() uses diameter by default for both its width & height!
You’re right. My bad. Edited my original post.
For completeness’ sake, we can make ellipse() (possibly circle() as well since I haven’t installed 3.5.1 yet to confirm it) use radius in place of diameter for both its width & height by calling ellipseMode(RADIUS);
:
A small warning: if we intend to have our Java Mode sketch to automatically transpile to JS via Pjs, we should avoid both circle() & square() completely!
Thanks @JackWitherell this was insightful! makes sense.
Circle and square have been added to the reference.
…and yes, it looks like the arguments / render style for circle and square are controlled by ellipseMode() and rectMode(), just as with ellipse and rect.