New Functions in PROCESSING 3.5

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.
Untitleaaad

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! :no_mouth:

1 Like

aaaa
You’re right. My bad. Edited my original post.

1 Like

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);: :radio_button:

Processing.org/reference/ellipseMode_.html

1 Like

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! :crying_cat_face:

ProcessingJS.org/reference/

Thanks @JackWitherell this was insightful! makes sense.

1 Like

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.

1 Like