Skip to content

TextBoxBase.cs

Charles Humphrey edited this page Nov 19, 2017 · 2 revisions

RandomchaosMGUIBase.UIBaseClasses.TextBoxBase

Guess what this class does :)

Public Properties

Color TextColor

Color of the text in the text box.

string PromptText

The prompt text, this is text you can use to indicate the fields use.

string Text

This is the actual text in the text box.

string SelectedText

This is the text currently selected.

int CursorPos

This is the current cursor position in the text box.

Public Fields

Vector2 TextOffset

Used to offset the text in the text box, default is 8,8

Color ForeColor

This is the color of the Text.

Color ForePromptColor

This is the color of the Prompt text.

Color UnselectedBorderColor

This is the color of the border when not selected or hovering over.

Color HoverBorderColor

This is the border color when the mouse is over.

Color SelctedBorderColor

This is the border color when the text box has focus.

Public Methods

TextBoxBase(Game game, Rectangle sizeRect, string fontAsset, string backgroundAsset = null)

Constructor.

void Update(GameTime gameTime)

As well as calling base.Update(gameTime), this then goes on to handle text input from the KeyboardStateManager

void Draw(GameTime gameTime)

As well as calling base.Draw(gameTime), this method then renders the Text and the Cursor as and when required.

Clone this wiki locally