Game Development Community

Changing the window size/resolution

by Chris Serino · in Torque X 2D · 08/25/2007 (10:39 pm) · 3 replies

I'm trying to make a game that requires the widescreen aspect ratio. So I'm trying to get the game window when I run the game on my computer to be widescreen (in my case, 1280x720), but I can't find anywhere to change the window size. Does anyone know a way to do it?

#1
12/22/2007 (8:44 am)
I found this yesterday while trying to figure out how to get a title text to be centered on the screen. Take a peek at the API for more info:

//int scrW = Game.GameInstance.GraphicsDeviceManager.GraphicsDevice.DisplayMode.Width;
//int scrH = Game.GameInstance.GraphicsDeviceManager.GraphicsDevice.DisplayMode.Height;

int scrW = Game.GameInstance.GraphicsDeviceManager.GraphicsDevice.Viewport.Width;
int scrH = Game.GameInstance.GraphicsDeviceManager.GraphicsDevice.Viewport.Height;

Viewport was used for the game screen size, and DisplayMode is for the computer resolution. I hope this helps.



- A -
#2
12/22/2007 (9:11 am)
Cool... I was just writing about this subject over here....

John K.
#3
12/22/2007 (10:55 am)
Good write up John. I haven't tried my solution for the xbox, but I know at least it works for the PC.