* - Adding Factory for Texture2D to create from a list (ie lay a list of texture2D row by row)

* - Adding AddScreen method to ScreenManager to make the PlayerIndex optional (default of PlayerIndex.One)
This commit is contained in:
Nathan Adams
2012-08-02 20:59:41 -05:00
parent 9bab7985ee
commit 4c7c9e6d61
7 changed files with 30 additions and 2 deletions

View File

@@ -289,6 +289,27 @@ namespace GameStateManagement
TouchPanel.EnabledGestures = screen.EnabledGestures;
}
/// <summary>
/// Adds a new screen to the screen manager with a default PlayerIndex of one
/// </summary>
public void AddScreen(GameScreen screen)
{
screen.ControllingPlayer = PlayerIndex.One;
screen.ScreenManager = this;
screen.IsExiting = false;
// If we have a graphics device, tell the screen to load content.
if (isInitialized)
{
screen.Activate(false);
}
screens.Add(screen);
// update the TouchPanel to respond to gestures this screen is interested in
TouchPanel.EnabledGestures = screen.EnabledGestures;
}
/// <summary>
/// Removes a screen from the screen manager. You should normally