C# Class ScreenManagement.ScreenManager

Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
显示文件 Open project: giladgray/XNA-ScreenManager

Public Methods

Method Description
AddScreen ( GameScreen GameScreen, PlayerIndex controllingPlayer ) : void

Adds a new GameScreen to the GameScreen manager.

Draw ( GameTime gameTime ) : void

Tells each GameScreen to draw itself.

FadeBackBufferToColor ( Color color, int alpha ) : void

Helper draws a translucent black fullscreen sprite, used for fading screens in and out, and for darkening the background behind popups.

GetScreen ( int index ) : GameScreen

Get a screen by index.

GetScreens ( ) : ScreenManagement.GameScreen[]

Expose an array holding all the screens. We return a copy rather than the real master list, because screens should only ever be added or removed using the AddScreen and RemoveScreen methods.

Initialize ( ) : void

Initializes the GameScreen manager component.

RemoveAllScreens ( ) : void

Removes all GameScreens from the GameScreen manager. You should normally use GameScreen.ExitScreen instead of calling this directly, so the GameScreens can gradually transition off rather than just being instantly removed.

RemoveScreen ( GameScreen GameScreen ) : void

Removes a GameScreen from the GameScreen manager. You should normally use GameScreen.ExitScreen instead of calling this directly, so the GameScreen can gradually transition off rather than just being instantly removed.

ScreenManager ( Game game ) : System

Constructs a new GameScreen manager component.

Update ( GameTime gameTime ) : void

Allows each GameScreen to run logic.

Protected Methods

Method Description
LoadContent ( ) : void

Load your graphics content.

UnloadContent ( ) : void

Unload your graphics content.

Private Methods

Method Description
TraceScreens ( ) : void

Prints a list of all the screens, for debugging.

Method Details

AddScreen() public method

Adds a new GameScreen to the GameScreen manager.
public AddScreen ( GameScreen GameScreen, PlayerIndex controllingPlayer ) : void
GameScreen GameScreen
controllingPlayer PlayerIndex
return void

Draw() public method

Tells each GameScreen to draw itself.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

FadeBackBufferToColor() public method

Helper draws a translucent black fullscreen sprite, used for fading screens in and out, and for darkening the background behind popups.
public FadeBackBufferToColor ( Color color, int alpha ) : void
color Color
alpha int
return void

GetScreen() public method

Get a screen by index.
public GetScreen ( int index ) : GameScreen
index int
return GameScreen

GetScreens() public method

Expose an array holding all the screens. We return a copy rather than the real master list, because screens should only ever be added or removed using the AddScreen and RemoveScreen methods.
public GetScreens ( ) : ScreenManagement.GameScreen[]
return ScreenManagement.GameScreen[]

Initialize() public method

Initializes the GameScreen manager component.
public Initialize ( ) : void
return void

LoadContent() protected method

Load your graphics content.
protected LoadContent ( ) : void
return void

RemoveAllScreens() public method

Removes all GameScreens from the GameScreen manager. You should normally use GameScreen.ExitScreen instead of calling this directly, so the GameScreens can gradually transition off rather than just being instantly removed.
public RemoveAllScreens ( ) : void
return void

RemoveScreen() public method

Removes a GameScreen from the GameScreen manager. You should normally use GameScreen.ExitScreen instead of calling this directly, so the GameScreen can gradually transition off rather than just being instantly removed.
public RemoveScreen ( GameScreen GameScreen ) : void
GameScreen GameScreen
return void

ScreenManager() public method

Constructs a new GameScreen manager component.
public ScreenManager ( Game game ) : System
game Game
return System

UnloadContent() protected method

Unload your graphics content.
protected UnloadContent ( ) : void
return void

Update() public method

Allows each GameScreen to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void