C# Class Indiefreaks.Xna.Rendering.Gui.Screen

A screen contains multiple controls and supports direct rendering to screen or to a texture for a latter usage such as using a 3D quad
Inheritance: IGuiElement, IUpdate
Afficher le fichier Open project: Indiefreaks/igf Class Usage Examples

Méthodes publiques

Méthode Description
Add ( Control control ) : void

Adds a control to the screen

HandleInput ( PlayerInput input, GameTime gameTime ) : void

Handles the input events from the player controlling the current control

Invalidate ( ) : void

Marks this Screen as requiring to be refreshed

LoseFocus ( ) : void

Removes focus from the current control

OnFocusAcquired ( ) : void

OnFocusLost ( ) : void

PrepareRenderTarget ( GraphicsDevice device ) : void

Creates or recreate the RenderTarget where the screen will be rendered

Refresh ( GraphicsDevice device ) : void

Refreshes the Screen properties when it requires to be redrawn to the RenderTarget

Remove ( Control control ) : void

Removes a control from the screen

RemoveAll ( ) : void
Screen ( ) : System

Creates a new instance that renders to screen

Screen ( bool renderToScreen ) : System

Creates a new instance without input support

Screen ( bool renderToScreen, bool isMenu, PlayerInput playerInput ) : System

Creates a new instance which width and height are set to the current Viewport Width and Height

Screen ( bool renderToScreen, bool isMenu, PlayerInput playerInput, int width, int height ) : System

Creates a new instance

SetFocus ( ) : void

Sets focus to the current control

Update ( GameTime gameTime ) : void

Update loop call

Private Methods

Méthode Description
IGuiElement ( GraphicsDevice device ) : void

Refreshes the Screen properties when it requires to be redrawn to the RenderTarget

IGuiElement ( SpriteBatch spriteRenderer ) : void

Renders the Screen

Method Details

Add() public méthode

Adds a control to the screen
public Add ( Control control ) : void
control Control
Résultat void

HandleInput() public méthode

Handles the input events from the player controlling the current control
public HandleInput ( PlayerInput input, GameTime gameTime ) : void
input Indiefreaks.Xna.Input.PlayerInput The current player input states
gameTime Microsoft.Xna.Framework.GameTime The GameTime instance
Résultat void

Invalidate() public méthode

Marks this Screen as requiring to be refreshed
public Invalidate ( ) : void
Résultat void

LoseFocus() public méthode

Removes focus from the current control
public LoseFocus ( ) : void
Résultat void

OnFocusAcquired() public méthode

public OnFocusAcquired ( ) : void
Résultat void

OnFocusLost() public méthode

public OnFocusLost ( ) : void
Résultat void

PrepareRenderTarget() public méthode

Creates or recreate the RenderTarget where the screen will be rendered
public PrepareRenderTarget ( GraphicsDevice device ) : void
device GraphicsDevice
Résultat void

Refresh() public méthode

Refreshes the Screen properties when it requires to be redrawn to the RenderTarget
public Refresh ( GraphicsDevice device ) : void
device GraphicsDevice
Résultat void

Remove() public méthode

Removes a control from the screen
public Remove ( Control control ) : void
control Control
Résultat void

RemoveAll() public méthode

public RemoveAll ( ) : void
Résultat void

Screen() public méthode

Creates a new instance that renders to screen
public Screen ( ) : System
Résultat System

Screen() public méthode

Creates a new instance without input support
public Screen ( bool renderToScreen ) : System
renderToScreen bool Set it to true to render directly to screen; false to use the Texture property and render the Screen content elsewhere
Résultat System

Screen() public méthode

Creates a new instance which width and height are set to the current Viewport Width and Height
public Screen ( bool renderToScreen, bool isMenu, PlayerInput playerInput ) : System
renderToScreen bool Set it to true to render directly to screen; false to use the Texture property and render the Screen content elsewhere
isMenu bool If set to true, the inner Buttons will react as in a standard menu; false means that you'll control how inner controls react to input events within their Control.HandleInput() method
playerInput Indiefreaks.Xna.Input.PlayerInput The player input state instance. One Screen can only be controlled by One PlayerInput instance
Résultat System

Screen() public méthode

Creates a new instance
public Screen ( bool renderToScreen, bool isMenu, PlayerInput playerInput, int width, int height ) : System
renderToScreen bool Set it to true to render directly to screen; false to use the Texture property and render the Screen content elsewhere
isMenu bool If set to true, the inner Buttons will react as in a standard menu; false means that you'll control how inner controls react to input events within their Control.HandleInput() method
playerInput Indiefreaks.Xna.Input.PlayerInput The player input state instance. One Screen can only be controlled by One PlayerInput instance
width int The width of the screen, this will be also be used for the inner RenderTarget2D if renderToScreen is set to true
height int The height of the screen, this will be also be used for the inner RenderTarget2D if renderToScreen is set to true
Résultat System

SetFocus() public méthode

Sets focus to the current control
public SetFocus ( ) : void
Résultat void

Update() public méthode

Update loop call
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void