C# 클래스 TraceRacer.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
파일 보기 프로젝트 열기: alexcoco/trace_racer 1 사용 예제들

공개 메소드들

메소드 설명
Activate ( bool instancePreserved ) : bool
AddScreen ( GameScreen screen, PlayerIndex 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 ( ) : TraceRacer.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, PlayerIndex controllingPlayer ) : void
screen GameScreen
controllingPlayer PlayerIndex
리턴 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 ( ) : TraceRacer.GameScreen[]
리턴 TraceRacer.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