We are about to switch to a new forum software. Until then we have removed the registration on this forum.
There are 2 possibilities to start a sketch:
Sketch Run (Ctrl-R) run windowed
Sketch Present (Ctrl-Shift-R) run fullscreen
In case of sketch is started with 'Run' command, a window with defined size should be opened. e.g.: size(800, 480, P3D);
On the other hand, it should be startet fullscreen! e.g.: size(displayWidth, displayHeight, P3D);
This will result e.g. to this coding:
// fullScreen should become a global variable provided by Processing!
boolean fullScreen = false; // true if started with Ctrl-Shift-R
// false if startet with Ctrl-R
void setup()
{ if (fullScreen)
size(displayWidth, displayHeight); // start full screen
if (!fullScreen)
size(800, 480); // start windowed
}
void draw()
{ background(111);
textSize(60);
textAlign(CENTER, CENTER);
text ("drawing size: " + width + "*" + height, width/2, height/2-60);
text ("screen size: " + displayWidth + "*" + displayHeight, width/2, height/2+60);
} // this example works with processing v2.2.1.
But with processing v3.0 it's not allowed to use size(x,y,mode) twice. See https://processing.org/reference/size_.html
Now some questions about this starting problem:
Can I get an information on how the sketch was started?
Is it possible to start a sketch with defined window size or fullscreen depending on the start command?
If mode=JavaScript, sketch should start with a defined window size. If mode=Android, sketch should always be started fullscreen. How can this be made?
ps. Some infos about it
https://github.com/processing/processing/wiki/Window-Size-and-Full-Screen
Answers
Thanx for your hint! You have to dig deep in the bowels of processing for that solution. Because processing v3.0 forbit double 'size()' and 'fullScreen()' usage, I think this topic can only be solved by the developer team of processing !
Dear developers, please can you think about an easy to use solution for all users?
I was checking your function and its working! Starting full screen mode switches to full screen, but e.g. calling surface.setSize(500,500); freezes the sketch (tested under Win-7 Pro SP1, processing v3.0 64 bit).
I use this test frame:
It doesn't freeze for me! Rather erratic positioning behavior.
Below my test case I was using to "develop" my hack: :P
With this hack the sketch can be started full screen with the Ctrl-Shift-R command, but the moving circle is only visible, if it is located within the rectangle given bei the 'size(800, 480, P2D);' command on my PC (Win7).
At the end the answers of my questions are...
--> NO
--> YES, but drawing fails afterwards
--> at the moment there is no JavaScript available :-(
So I only can repeat my request of this requirements. Dear developers, please can you think about an easy to use solution for all users?
https://GitHub.com/fjenett/javascript-mode-processing/issues/33
https://GitHub.com/processing/processing/issues