C# Класс PrinceGame.ScreenManager

The screen manager is a component which manages one or more GameScreen instances. It maintains a stack of screens, calls their Update and Draw methods at the appropriate times, and automatically routes input to the topmost active screen.
Наследование: Microsoft.Xna.Framework.DrawableGameComponent
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
m_spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

Открытые методы

Метод Описание
Activate ( bool instancePreserved ) : bool
AddScreen ( GameScreen screen, System controllingPlayer ) : void

Adds a new screen to the screen manager.

Deactivate ( ) : void

Informs the screen manager to serialize its state to disk.

Draw ( GameTime gameTime ) : void

Tells each screen to draw itself.

FadeBackBufferToBlack ( float alpha ) : void

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

GetScreens ( ) : 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 screen manager component.

RemoveScreen ( GameScreen screen ) : void

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

ScreenManager ( Microsoft.Xna.Framework.Game game ) : System

Constructs a new screen manager component.

Update ( GameTime gameTime ) : void

Allows each screen to run logic.

Защищенные методы

Метод Описание
LoadContent ( ) : void

Load your graphics content.

UnloadContent ( ) : void

Unload your graphics content.

Приватные методы

Метод Описание
TraceScreens ( ) : void

Prints a list of all the screens, for debugging.

Описание методов

Activate() публичный Метод

public Activate ( bool instancePreserved ) : bool
instancePreserved bool
Результат bool

AddScreen() публичный Метод

Adds a new screen to the screen manager.
public AddScreen ( GameScreen screen, System controllingPlayer ) : void
screen GameScreen
controllingPlayer System
Результат void

Deactivate() публичный Метод

Informs the screen manager to serialize its state to disk.
public Deactivate ( ) : void
Результат void

Draw() публичный Метод

Tells each screen to draw itself.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

FadeBackBufferToBlack() публичный Метод

Helper draws a translucent black fullscreen sprite, used for fading screens in and out, and for darkening the background behind popups.
public FadeBackBufferToBlack ( float alpha ) : void
alpha float
Результат void

GetScreens() публичный Метод

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 ( ) : GameScreen[]
Результат GameScreen[]

Initialize() публичный Метод

Initializes the screen manager component.
public Initialize ( ) : void
Результат void

LoadContent() защищенный Метод

Load your graphics content.
protected LoadContent ( ) : void
Результат void

RemoveScreen() публичный Метод

Removes a screen from the screen manager. You should normally use GameScreen.ExitScreen instead of calling this directly, so the screen can gradually transition off rather than just being instantly removed.
public RemoveScreen ( GameScreen screen ) : void
screen GameScreen
Результат void

ScreenManager() публичный Метод

Constructs a new screen manager component.
public ScreenManager ( Microsoft.Xna.Framework.Game game ) : System
game Microsoft.Xna.Framework.Game
Результат System

UnloadContent() защищенный Метод

Unload your graphics content.
protected UnloadContent ( ) : void
Результат void

Update() публичный Метод

Allows each screen to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

Описание свойств

m_spriteBatch публичное статическое свойство

public static SpriteBatch,Microsoft.Xna.Framework.Graphics m_spriteBatch
Результат Microsoft.Xna.Framework.Graphics.SpriteBatch