In game - windowed / full screen toggle?

Started by Husky, Thu 27/07/2006 20:29:48

Previous topic - Next topic

Husky

Question: Is it possible to give the player the ability to toggle between windowed mode and full screen mode in the game?Ã,  What specific command words do I need to use to accomplish this?

Details: I've been trying using words like “System.Windowed” that I've found in the manual.Ã,  But I get an error saying that “System.Windowed” is read only.Ã,  This is what I have so far:

For windowed 320 x 240:
Code: ags

System.Windowed = true;
System.ScreenWidth = 320;
System.ScreenHeight = 240;


For windowed 640 x 480:
Code: ags

System.Windowed = true;
System.ScreenWidth = 640;
System.ScreenHeight = 480;


For full screen:
Code: ags

System.Windowed = false;
System.ScreenWidth = 640;
System.ScreenHeight = 480;


My high end graphics card does not support full screen 320 x 240. (I've read that others with lab top screens have this same problem)Ã,  Ã, So my theoretical work around is to simply have full screen run in 640 x 480 even though the game is drawn for 320 x 240.Ã,  Ã, I wonder if this will work?

Any thoughts you have on this matter are greatly appreciated.Ã,  Thank you in advance.

GarageGothic

To the best of my knowledge, no it's not possible to toggle between screen modes from within the game. The properties that you mention are, as should also be stated in the manual, read only.

But your workaround should work fine if your change the resolution in the winsetup.exe menu. You can either set the resolution (for a 320x240) game to 640x480 - which would also make scaled characters look slightly better, OR in newer AGS versions you can use one of the graphics filters to run in double or triple resolution.

Husky

Thank you for the reply, GarageGothic.
These new graphic filters are interesting indeed, thank you for informing me about them!Ã,  I've been playing around with these filters and finding what I can about them in the manual, but I still have a question:Ã,  Is it possible for the player to initialize these filter modes while playing the game?Ã,  Where I find the command words to do this?Ã,  What I want is for the player to have the ability to change resolution in game (ideally toggle to full screen, but I understand that it is not supported), so they do not have to exit and restart the game to accomplish resolution changes.
Thanks, again.

GarageGothic

#3
No, all viewport settings are initialized at game start and can't be changed from in-game (except smooth character scaling and vsync). This is true for resolution, color depth (force 16-bit mode in a 32-bit game) and the new filters. In theory you CAN change these settings from in-game  - by reading/writing to the acsetup.cfg file - but the game would always have to be restarted anyway for the changes to take effect.

Why is it so important for you to change them from in-game?

Edit: One further problem in changing the resolution (though not the windowed/nonwindowed state) is that savegames saved at 320x200 won't work in 640x400 resolution and vice versa.

Edit 2: I just did some tests of one solution I could think of, but it seems that the RunAGSGame function does NOT re-initialize the viewport (my test was starting a game in full screen, ALT-TAB'ing to windows, editing the .cfg file by hand and setting "windowed=1", ALT-TAB'ing back to the game and triggering a RunAGSGame restarting the same game .exe). The restarted game was still full screen.

Husky

Thanks for the help GarageGothic.Ã,  I realize now that it is not so easy (or really possible) to just switch resolutions mid game.Ã,  Therefore, I think I'll abandon my pursuit in doing this.Ã,  The reason I wanted to do this in the first place, was simply to give the player more control â€" that's all.Ã,  This is no biggy.Ã,  I'll be moving on and focusing on other areas of the game.Ã,  Thanks again.

SMF spam blocked by CleanTalk