Jump to content
  • Advertisement
Sign in to follow this  

[.net] [XNA] Resetting the Window Size

This topic is 4097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!