We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Greetings.
The following code works just fine in 3.0 beta 5.
size (400, 400);
final float d = width / 2.0;
ellipse (d, d, d, d);
However, the code counts on width
being a constant; otherwise the line defining d
would fail.
I use this property of width
quite extensively in teaching material. (I can justify this in detail, but it's probably not that relevant here.) Is it safe to assume that in Processing width
and height
are always constants?
Answers
surface.setResizable(true);
though. As both width & height can be changed by the user.Greetings.
Yes, I knew of the possibility to change width and size. In our examples we never change the size.
Actually, now that I think of it, my question is kind of weird. I guess it is obvious that you can define a constant using the value of a variable, because this assignment is done only once.
So my question is pretty much unnecessary. You can even delete it if you want to.
Sorry and thanks!