Sign in to follow this  

[.net] [XNA] Resetting the Window Size

Recommended Posts

Hi, starting to use XNA with C#, and working great so far. When my game is first launched, I want the window to be rather small..because it only holds a small login window..which is fine. I do it with the following code in the constructor
gameState = GameState.LoginScreen;
graphics.PreferredBackBufferWidth = mySmallWidth;
graphics.PreferredBackBufferHeight = mySmallHeight;
Problem arises when I try to make the screen bigger (after they login)..I try to use the following code when the the user clicks the login button.
//login successful
gameState = GameState.MainGame;
graphics.PreferredBackBufferWidth = myBiggerWidth;
graphics.PreferredBackBufferHeight = myBiggerHeight;
But of course, the window doesn't get any larger, and I can't figure out how to change it, after it's initally set. Any help would be appreciated. Thanks, ArchG

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this