C# Class Descent.GUI.InputElement

Takes input from the user and displays everything entered so far. The content can be deleted (character by character) by the backspace key and the value of a specific instance can be read (or set) statically by knowing the instance's key.
Inheritance: GUIElement
Mostrar archivo Open project: nezbo/Descent Class Usage Examples

Public Methods

Method Description
Draw ( SpriteBatch draw ) : void
GetInputFrom ( string key ) : string

Gets the current input from a specific input element through it's key. If two input elements share the same key, they will display the same text and always change together.

HandleKeyPress ( Keys key ) : void
InputElement ( Microsoft.Xna.Framework.Game game, string inputName, int x, int y, int width, int height ) : System.Collections.Generic

Create a new input element at the given position and saves the input to its name (key).

SetInput ( string key, string input ) : void

Sets the value for a given key.

Method Details

Draw() public method

public Draw ( SpriteBatch draw ) : void
draw Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

GetInputFrom() public static method

Gets the current input from a specific input element through it's key. If two input elements share the same key, they will display the same text and always change together.
public static GetInputFrom ( string key ) : string
key string The the key for the input element whose input is wanted.
return string

HandleKeyPress() public method

public HandleKeyPress ( Keys key ) : void
key Keys
return void

InputElement() public method

Create a new input element at the given position and saves the input to its name (key).
public InputElement ( Microsoft.Xna.Framework.Game game, string inputName, int x, int y, int width, int height ) : System.Collections.Generic
game Microsoft.Xna.Framework.Game The current game object.
inputName string The name is used to (internally) save the input and /// to retrieve it externally.
x int The top-left x-coordinate.
y int The top-left x-coordinate.
width int The width of the input element.
height int The height of the input element.
return System.Collections.Generic

SetInput() public static method

Sets the value for a given key.
public static SetInput ( string key, string input ) : void
key string The key for the value to set.
input string The new input for the given key.
return void