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
Mostra file Open project: Indiefreaks/igf Class Usage Examples

Public Methods

Method 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

Method 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 method

Adds a control to the screen
public Add ( Control control ) : void
control Control
return void

HandleInput() public method

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
return void

Invalidate() public method

Marks this Screen as requiring to be refreshed
public Invalidate ( ) : void
return void

LoseFocus() public method

Removes focus from the current control
public LoseFocus ( ) : void
return void

OnFocusAcquired() public method

public OnFocusAcquired ( ) : void
return void

OnFocusLost() public method

public OnFocusLost ( ) : void
return void

PrepareRenderTarget() public method

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

Refresh() public method

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

Remove() public method

Removes a control from the screen
public Remove ( Control control ) : void
control Control
return void

RemoveAll() public method

public RemoveAll ( ) : void
return void

Screen() public method

Creates a new instance that renders to screen
public Screen ( ) : System
return System

Screen() public method

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
return System

Screen() public method

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
return System

Screen() public method

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
return System

SetFocus() public method

Sets focus to the current control
public SetFocus ( ) : void
return void

Update() public method

Update loop call
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void