Full Screen / Window Size

Monkey Forums/Monkey Programming/Full Screen / Window Size

Qube(Posted 2011) [#1]
I'm probably being dumb here and have a newbie question...

Say I'm developing an iPhone or iPad game in OS X and during development I don't want to be testing on the actual device every few minutes as that is very long winded. Also the simulator isn't great, so my question is :

How do I set an app to run full screen or set the actual window size? - At the moment each window size is 640x480.

At the moment I'm setting the build for GLFW as I don't have an option to compile for OS X or Windows (should I?) but I see no where or how to define full screen or windows size.


Xaron(Posted 2011) [#2]
There is a config.h in the build directory where you can set this.


Qube(Posted 2011) [#3]
So I have to compile and build again each time?


Xaron(Posted 2011) [#4]
Hmm... Looks like. Maybe Mark could shed a light onto that issue?


Qube(Posted 2011) [#5]
Hope so as it seems a little long winded to have to compile (translate?), edit the file and then build each time you want to see your creation coming along in all its full screen glory.

Should there also be a native OS X option when building or is that GLFW the only option for OS X / Win?


Sledge(Posted 2011) [#6]
Personally I test what will eventually be iOS builds by building to HTML5. You only need to edit the canvas size in MonkeyGame.html the once.


DruggedBunny(Posted 2011) [#7]
Only change the config.h (or similar) file within your build folder -- you don't have to do it each time as only certain parts are replaced.

Try it on a HTML5 build -- edit MonkeyGame.html as below:

<canvas id="GameCanvas" onclick="javascript:this.focus();" width=640 height=480 ...


Edit game, run again and it'll keep the change.


MikeHart(Posted 2011) [#8]
GLFW IS the native part.


Sledge(Posted 2011) [#9]
For Flash you can set the res by editing (Notepad is fine) the MonkeyGame.as template in C:\Program Files\Monkey\targets\flash.


ziggy(Posted 2011) [#10]
For Flash you can set the res by editing (Notepad is fine) the MonkeyGame.as template in C:\Program Files\Monkey\targets\flash.

all projects that compile to flash take this as the basis. It's much more recommended to modify the same file in the .build folder of your game. This way, you can adapt it per-project.
Rebuilds won't overwrite it. New builds only modifies the code between the ${TRANSCODE_BEGIN} and ${TRANSCODE_END}
(metadata tags are also overwritten on js).


DruggedBunny(Posted 2011) [#11]
Yeah, in general you shouldn't touch the targets/ templates at all -- Mark will shout at you -- just your copy of the template in yourproject.build/target/


Sledge(Posted 2011) [#12]
That is better advice (although, for me, setting the default to a res I will more commonly require means less faffing in the long run so I'd stand by there being some utility to it).


degac(Posted 2011) [#13]
Looking in the various target's file (Flash, HTML5, Android, and so on) seems that should be quite easy (as they are .txt file at the end...) width=640 with something more useful like $CANVAS_WIDTH and $CANVAS_HEIGHT.
Adding 2 more PRECOMPILER_DIRECTIVE like #CANVAS_WIDTH and #CANVAS_HEIGHT seems no so difficult to do.
When compiled the new value are 'replaced' and if they are not present a default value is taken (ie: 640x480).

Just an idea!

ps: on Android I suppose this is not necessary as there are "fill_parent" as layout_width/height


Soap(Posted 2011) [#14]
Yeah, this surprises me you can't even set it in the code, should you have 4 different targets, you need to edit it in 4 different places should you want to change them. :\


sknightly(Posted 2011) [#15]
But if you have 4 different targets, you'll probably need 4 different resolutions...

You only have to alter the files in your build folder once per project, not that big a deal.


Chroma(Posted 2011) [#16]
There is a config.h in the build directory where you can set this.
Unacceptable...