C# Класс GameStateManagement.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.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
Game LDEngine.Game
Input InputState
ScaledMousePos Point
blankTexture Texture2D

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

Метод Описание
AddScreen ( GameScreen screen ) : void

Adds a new screen to the screen manager.

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 ( ) : GameStateManagement.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.

LoadContent ( ) : void

Load your graphics content.

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 ( LDEngine game ) : System

Constructs a new screen manager component.

TraceScreens ( ) : void

Prints a list of all the screens, for debugging.

UnloadContent ( ) : void

Unload your graphics content.

Update ( GameTime gameTime ) : void

Allows each screen to run logic.

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

Метод Описание
CloseAllScreens ( ) : void
CloseScreen ( Type type ) : void

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

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

Adds a new screen to the screen manager.
public AddScreen ( GameScreen screen ) : void
screen GameScreen
Результат 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 ( ) : GameStateManagement.GameScreen[]
Результат GameStateManagement.GameScreen[]

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

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

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

Load your graphics content.
public 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 ( LDEngine game ) : System
game LDEngine
Результат System

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

Prints a list of all the screens, for debugging.
public TraceScreens ( ) : void
Результат void

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

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

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

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

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

Game публичное свойство

public LDEngine.Game Game
Результат LDEngine.Game

Input публичное свойство

public InputState,GameStateManagement Input
Результат InputState

ScaledMousePos публичное свойство

public Point ScaledMousePos
Результат Point

blankTexture публичное свойство

public Texture2D blankTexture
Результат Texture2D