We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Since displayWidth and displayHeight are deprecated in Processing 3, what is the easy way to obtain the pixel dimensions (raw or retina/doubled) of the screen? (Not the window/sketch size, the display size.)
Answers
They were added to the language to run at full screen with
size(displayWidth, displayHeight)
. Now you can usefullScreen()
and then get the full display withwidth
andheight
. They are deprecated, but they still work in 3.0.Yes, but there should be a way to obtain the pixel dimensions of the physical screen decoupled from the size of the sketch. This isn't (conveniently) possible if
displayWidth
anddisplayHeight
are no longer available.In other words, one should be able to run a sketch at any size; and regardless of the sketch size, be able to obtain the physical screen dimensions easily. For example, I might want to have a window that is 50% the size of the screen, but draw a shape that is some ratio of the screen dimensions.
(I am trying to make a case for not deprecating those two variables.) :)
I don't understand why the issue of deprecating useful features which got no real substitute.
Fields displayWidth & displayHeight are important environment information.
There are times we want a resolution which is 3/4 of desktop's dimensions for example:
size(displayWidth*3>>2, displayHeight*3>>2);
Threatening removing features is counter productive. Folks want more not less features.
Moreover, it creates a chasm of insecurity about how much time a feature is gonna keep working or what's the next cutoff "deprecated" victim's gonna be!
Heck, Processing doesn't even provide a version constant so a code can check out the environment version it's currently running under.
Also Processing has lost many deployment capabilities since Processing 2 had started!
And to compound for it all, Processing 3 is spreading
private
everywhere, making things more difficult or even impossible to tame for our custom needs or patch some bug on-the-fly! X(