C# Класс 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.
Наследование: GUIElement
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

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

public Draw ( SpriteBatch draw ) : void
draw Microsoft.Xna.Framework.Graphics.SpriteBatch
Результат void

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

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.
Результат string

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

public HandleKeyPress ( Keys key ) : void
key Keys
Результат void

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

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.
Результат System.Collections.Generic

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

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.
Результат void