C# 클래스 TraceRacer.GameScreen

A screen is a single layer that has update and draw logic, and which can be combined with other layers to build up a complex menu system. For instance the main menu, the options menu, the "are you sure you want to quit" message box, and the main game itself are all implemented as screens.
파일 보기 프로젝트 열기: alexcoco/trace_racer 1 사용 예제들

공개 메소드들

메소드 설명
Activate ( bool instancePreserved ) : void

Activates the screen. Called when the screen is added to the screen manager or if the game resumes from being paused or tombstoned.

Deactivate ( ) : void

Deactivates the screen. Called when the game is being deactivated due to pausing or tombstoning.

Draw ( GameTime gameTime ) : void

This is called when the screen should draw itself.

ExitScreen ( ) : void

Tells the screen to go away. Unlike ScreenManager.RemoveScreen, which instantly kills the screen, this method respects the transition timings and will give the screen a chance to gradually transition off.

HandleInput ( GameTime gameTime, InputState input ) : void

Allows the screen to handle user input. Unlike Update, this method is only called when the screen is active, and not when some other screen has taken the focus.

Unload ( ) : void

Unload content for the screen. Called when the screen is removed from the screen manager.

Update ( GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen ) : void

Allows the screen to run logic, such as updating the transition position. Unlike HandleInput, this method is called regardless of whether the screen is active, hidden, or in the middle of a transition.

비공개 메소드들

메소드 설명
UpdateTransition ( GameTime gameTime, System.TimeSpan time, int direction ) : bool

Helper for updating the screen transition position.

메소드 상세

Activate() 공개 메소드

Activates the screen. Called when the screen is added to the screen manager or if the game resumes from being paused or tombstoned.
public Activate ( bool instancePreserved ) : void
instancePreserved bool /// True if the game was preserved during deactivation, false if the screen is just being added or if the game was tombstoned. /// On Xbox and Windows this will always be false. ///
리턴 void

Deactivate() 공개 메소드

Deactivates the screen. Called when the game is being deactivated due to pausing or tombstoning.
public Deactivate ( ) : void
리턴 void

Draw() 공개 메소드

This is called when the screen should draw itself.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
리턴 void

ExitScreen() 공개 메소드

Tells the screen to go away. Unlike ScreenManager.RemoveScreen, which instantly kills the screen, this method respects the transition timings and will give the screen a chance to gradually transition off.
public ExitScreen ( ) : void
리턴 void

HandleInput() 공개 메소드

Allows the screen to handle user input. Unlike Update, this method is only called when the screen is active, and not when some other screen has taken the focus.
public HandleInput ( GameTime gameTime, InputState input ) : void
gameTime Microsoft.Xna.Framework.GameTime
input InputState
리턴 void

Unload() 공개 메소드

Unload content for the screen. Called when the screen is removed from the screen manager.
public Unload ( ) : void
리턴 void

Update() 공개 메소드

Allows the screen to run logic, such as updating the transition position. Unlike HandleInput, this method is called regardless of whether the screen is active, hidden, or in the middle of a transition.
public Update ( GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen ) : void
gameTime Microsoft.Xna.Framework.GameTime
otherScreenHasFocus bool
coveredByOtherScreen bool
리턴 void