C# Класс NScumm.MonoGame.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.
This public class is similar to one in the GameStateManagement sample.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Draw ( GameTime gameTime ) : void

This is called when the screen should draw itself.

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

LoadContent ( ) : void

Load graphics content for the screen.

UnloadContent ( ) : void

Unload content for the screen.

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.

UpdatePresence ( ) : void

Screen-specific update to gamer rich presence.

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

Метод Описание
UpdateTransition ( GameTime gameTime, System.TimeSpan time, int direction ) : bool

Helper for updating the screen transition position.

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

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

This is called when the screen should draw itself.
public abstract Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

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

public EndRun ( ) : void
Результат 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 ( InputState input ) : void
input InputState
Результат void

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

Load graphics content for the screen.
public LoadContent ( ) : void
Результат void

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

Unload content for the screen.
public UnloadContent ( ) : 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

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

Screen-specific update to gamer rich presence.
public UpdatePresence ( ) : void
Результат void