Game Development Community

Full screen for all!

by ArchonLight · in Torque Game Engine · 03/05/2009 (11:03 am) · 11 replies

Okay this may be somewhere in the resources. Basically what I want to do is switch it so the game Im working on can go full screen anyone got an idea on how to do that?? I saw the script function that allows you to do it, but here is the problem(keep in mind im not a very good coder, so hopefully this sounds right.

Say I have a game put onto an .exe it runs it installs the game all that good jazz, buttt say i have this installer on a flash drive ready to give to people to have fun with..their computer will have varying resolutions.

Can anyone think of a way in code like after its installed and they RUN the game to check what the current user's resolution and set it to that I mean they have to have that sort of functionality in other torque games right?? Or is it all done in a settings menu?

Also all the graphics for this game are coordinate based sos if the resolution changes it might screw up the graphics is it as simple as setting all the gui elements to relative?

#1
03/05/2009 (12:28 pm)
If you want the game to start in full screen then all you have to do is set $pref::Video::fullScreen = "1"; in client/prefs.cs. Look at the optionsDlg.gui in the starter.FPS for more examples.
#2
03/05/2009 (12:41 pm)
In defaults.cs look for
$pref::Video::fullScreen = 0;
set that to 1 for true. Delete .prefs. Let the user select resolution.
#3
03/05/2009 (1:04 pm)
what michael said it works only thing is where is the file to add resolutions and to delete the 1152 864 resolution as that resolution is not even a computer resolution and the computer messes up. i don't think i have never seen a resolution that size. :P
#4
03/05/2009 (1:27 pm)
Brandon, all you have to do is set the resolution to 800 by 600 and turn on full screen before you ship. That will act as the base settings for the end user and they can change it later if they want to.
#5
03/05/2009 (1:30 pm)
So wait which one?? Because one is for an engine change is it not?? and the other is in script. Also the question is if I do this will it screw up my graphics for the gui since they coordinate based?

The reason I am asking is because this game is going to be handed out with flash drives and I am just trying to insure that the person playing when they install can go full screen...So setting the standard to 800x600 and then allowing the person to change it would be the best way to go about it?
#6
03/05/2009 (2:04 pm)
No engine changes have been mentioned. $pref::Video::fullScreen is set in script. I believe Torque queries resolutions from your video card.

Let's not confuse resolution and full screen. Your computer can be set to 1280 x 1024, but you can run Torque full screen with a game resolution of 800 x 600. The full screen flag just tells the engine to run as such or not, resolution is different.

As for the GUI, if you set them up right you should be good to go. My rule of thumb is to make them look good at 800 x 600 and then test them by changing the resolution (which you can do in the GUI editor). The best way to make sure they stay in their proper places is to use plenty of GuiControls as containers. Positioning is based off of it's position relative to the parent. So if you put a bunch of controls directly on the screen you will have them moving all over the place when you change resolution. But if you put them in containers then the container may move around but the controls inside them do not. Does that make sense?
#7
03/05/2009 (2:07 pm)
I believe soo... I just need to make sure then they run the game it goes to full screen, takes up the entire amount of space without screwing up the gui.

Also is there a walkthrough for containers or is it as simpel as taking all my gui assets and putting them into a container?
#8
03/05/2009 (2:19 pm)
If yo don't already have it I would suggest getting The Game Programmer's Guide to Torque. He goes over the gui elements pretty well.

You can open your GUI file in a text editor and then wrap you controls in
new GuiControl(){
   profile = "GuiDefaultProfile";
   position = "0 0";
   extent = "640 480"; //<-- You may need to adjust this value
   minExtent = "640 480";  //<--This is the smallest is will resize to.
   visible = "1";
   helpTag = "0";

   //Put your controls here

};

Just make sure you don't wrap the inital GuiControl object. That one defines your screen.
#9
03/05/2009 (2:52 pm)
ya never mind my message about adding in other resolutions it seems i do have 1152 864 resolution for this computer. i just never used it but it still messes up my computer when i change to that from the game menu it also don't list every resolution i have it only lists 3 of them wheres my other resolutions. :P there are some people that don't want to go full screen and have it at a set resolution.

at lest this works though and i think i know why that 1152 864 don't work as its not set to the in the proper resolution that my computer is set at.
#10
03/06/2009 (5:33 pm)
The actual command if you want to change it through script is:
setScreenMode(%hRes, %vRes, %colorDepth, %fullscreenToggle);
* hRes = horizontal resolution
* vRes = vertical resolution
* colorDepth = 16 bpp or 32 bpp (bits per pixel)
* fullscreenToggle = 1 for true (fullscreen), 0 for false(windowed)

EXAMPLE: setScreenMode(1280, 800, 32, 1);
#11
03/06/2009 (6:11 pm)
@Brandon
Full Screen Mode enables the higher resolutions to be displayed on your monitor based on the Profile that Torque has assigned.
Also
Torque will use any Compatible Resolution... your Windows Resolution will only limit Torque's Windowed Mode Maximum Resolution

@Archon
Using Relative Positions will keep the controls at the desired locations in your GUI, though there may be some Stretching or Compressing you can better see what your GUI looks like using multiple resolutions for best end result.