• Advertisement
Sign in to follow this  

[.net] [XNA] Resetting the Window Size

This topic is 3826 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
Advertisement
IIRC there should be a window member of the game class and you can change its size too.
I may be mistaken though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement