Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Terraria.GameContent.UI.States.UIVirtualKeyboard Class Reference

Public Types

enum  KeyState { Default , Symbol , Shift }
 

Public Member Functions

delegate void KeyboardSubmitEvent (string text)
 
 UIVirtualKeyboard (string labelText, string startingText, KeyboardSubmitEvent submitAction, Action cancelAction, int inputMode=0, bool allowEmpty=false)
 
void SetMaxInputLength (int length)
 
void SetKeyState (KeyState keyState)
 
override void OnActivate ()
 
override void OnDeactivate ()
 
delegate void MouseEvent (UIMouseEvent evt, UIElement listeningElement)
 
delegate void ScrollWheelEvent (UIScrollWheelEvent evt, UIElement listeningElement)
 
delegate void ElementEvent (UIElement affectedElement)
 
delegate void UIElementAction (UIElement element)
 
void SetSnapPoint (string name, int id, Vector2? anchor=null, Vector2? offset=null)
 
bool GetSnapPoint (out SnapPoint point)
 
virtual void ExecuteRecursively (UIElementAction action)
 
void Append (UIElement element)
 
void Remove ()
 
void RemoveChild (UIElement child)
 
void RemoveAllChildren ()
 
virtual void Draw (SpriteBatch spriteBatch)
 
virtual void Update (GameTime gameTime)
 
Rectangle GetClippingRectangle (SpriteBatch spriteBatch)
 
virtual List< SnapPoint > GetSnapPoints ()
 
virtual void Recalculate ()
 
UIElement GetElementAt (Vector2 point)
 
virtual bool ContainsPoint (Vector2 point)
 
virtual Rectangle GetViewCullingArea ()
 
void SetPadding (float pixels)
 
virtual void RecalculateChildren ()
 
CalculatedStyle GetInnerDimensions ()
 
CalculatedStyle GetDimensions ()
 
CalculatedStyle GetOuterDimensions ()
 
void CopyStyle (UIElement element)
 
virtual void LeftMouseDown (UIMouseEvent evt)
 
virtual void LeftMouseUp (UIMouseEvent evt)
 
virtual void LeftClick (UIMouseEvent evt)
 
virtual void LeftDoubleClick (UIMouseEvent evt)
 
virtual void RightMouseDown (UIMouseEvent evt)
 
virtual void RightMouseUp (UIMouseEvent evt)
 
virtual void RightClick (UIMouseEvent evt)
 
virtual void RightDoubleClick (UIMouseEvent evt)
 
virtual void MouseOver (UIMouseEvent evt)
 
virtual void MouseOut (UIMouseEvent evt)
 
virtual void ScrollWheel (UIScrollWheelEvent evt)
 
void Activate ()
 
void DrawDebugHitbox (BasicDebugDrawer drawer, float colorIntensity=0f)
 
void Deactivate ()
 
void Initialize ()
 
virtual void OnInitialize ()
 
virtual int CompareTo (object obj)
 
int CompareTo (object? obj)
 
int CompareTo (T? other)
 

Static Public Member Functions

static void CycleSymbols ()
 
static void BackSpace ()
 
static void Submit ()
 
static void Cancel ()
 
static void Write (string text)
 
static void CursorLeft ()
 
static void CursorRight ()
 
static bool CanDisplay (int keyboardContext)
 
static void CacheCanceledInput (int cacheMode)
 

Public Attributes

Func< string, boolCustomTextValidationForUpdate
 
Func< string, boolCustomTextValidationForSubmit
 
Func< boolCustomEscapeAttempt
 
StyleDimension Top
 
StyleDimension Left
 
StyleDimension Width
 
StyleDimension Height
 
StyleDimension MaxWidth = StyleDimension.Fill
 
StyleDimension MaxHeight = StyleDimension.Fill
 
StyleDimension MinWidth = StyleDimension.Empty
 
StyleDimension MinHeight = StyleDimension.Empty
 
bool IgnoresMouseInteraction
 
bool OverflowHidden
 
SamplerState OverrideSamplerState
 
float PaddingTop
 
float PaddingLeft
 
float PaddingRight
 
float PaddingBottom
 
float MarginTop
 
float MarginLeft
 
float MarginRight
 
float MarginBottom
 
float HAlign
 
float VAlign
 
bool UseImmediateMode
 

Static Public Attributes

static int OffsetDown
 
static bool ShouldHideText
 

Protected Member Functions

override void DrawSelf (SpriteBatch spriteBatch)
 
virtual void DrawChildren (SpriteBatch spriteBatch)
 

Protected Attributes

readonly List< UIElementElements = new List<UIElement>()
 

Properties

string Text [get, set]
 
bool HideContents [get, set]
 
static bool CanSubmit [get]
 
static int KeyboardContext [get]
 
UIElement Parent [get, private set]
 
int UniqueId [get, private set]
 
IEnumerable< UIElementChildren [get]
 
bool IsMouseHovering [get, private set]
 

Events

MouseEvent OnLeftMouseDown
 
MouseEvent OnLeftMouseUp
 
MouseEvent OnLeftClick
 
MouseEvent OnLeftDoubleClick
 
MouseEvent OnRightMouseDown
 
MouseEvent OnRightMouseUp
 
MouseEvent OnRightClick
 
MouseEvent OnRightDoubleClick
 
MouseEvent OnMouseOver
 
MouseEvent OnMouseOut
 
ScrollWheelEvent OnScrollWheel
 
ElementEvent OnUpdate
 

Private Member Functions

void BuildSpaceBarArea (UIPanel mainPanel)
 
void PressSpace ()
 
bool CanRestore ()
 
void TypeText (UIMouseEvent evt, UIElement listeningElement)
 
void ValidateText ()
 
bool TextIsValidForSubmit ()
 
void StyleKey< T > (UITextPanel< T > button, bool external=false)
 
UITextPanel< object > CreateKeyboardButton (object text, int x, int y, int width=1, bool style=true)
 
bool ShouldShowKeyboard ()
 
bool TryEscapingMenu ()
 
void UpdateOffsetDown ()
 
void SetupGamepadPoints (SpriteBatch spriteBatch)
 
void InternalSubmit ()
 
void RestoreCanceledInput (int cacheMode)
 
void CopyTextToSign ()
 
void CopyTextToChest ()
 
void FadedMouseOver (UIMouseEvent evt, UIElement listeningElement)
 
void FadedMouseOut (UIMouseEvent evt, UIElement listeningElement)
 
CalculatedStyle GetDimensionsBasedOnParentDimensions (CalculatedStyle parentDimensions)
 

Private Attributes

UITextPanel< object >[] _keyList = new UITextPanel<object>[50]
 
UITextPanel< object > _shiftButton
 
UITextPanel< object > _symbolButton
 
UITextBox _textBox
 
UITextPanel< LocalizedText_submitButton
 
UITextPanel< LocalizedText_cancelButton
 
UIText _label
 
UITextPanel< object > _enterButton
 
UITextPanel< object > _spacebarButton
 
UITextPanel< object > _restoreButton
 
Asset< Texture2D_textureShift
 
Asset< Texture2D_textureBackspace
 
Color _internalBorderColor = new Color(89, 116, 213)
 
Color _internalBorderColorSelected = Main.OurFavoriteColor
 
UITextPanel< LocalizedText_submitButton2
 
UITextPanel< LocalizedText_cancelButton2
 
UIElement outerLayer1
 
UIElement outerLayer2
 
bool _allowEmpty
 
KeyState _keyState
 
KeyboardSubmitEvent _submitAction
 
Action _cancelAction
 
int _lastOffsetDown
 
int _keyboardContext
 
bool _edittingSign
 
bool _edittingChest
 
float _textBoxHeight
 
float _labelHeight
 
bool _canSubmit
 
bool _isInitialized
 
CalculatedStyle _innerDimensions
 
CalculatedStyle _dimensions
 
CalculatedStyle _outerDimensions
 
SnapPoint _snapPoint
 

Static Private Attributes

static UIVirtualKeyboard _currentInstance
 
static string _cancelCacheSign = ""
 
static string _cancelCacheChest = ""
 
const string DEFAULT_KEYS = "1234567890qwertyuiopasdfghjkl'zxcvbnm,.?"
 
const string SHIFT_KEYS = "1234567890QWERTYUIOPASDFGHJKL'ZXCVBNM,.?"
 
const string SYMBOL_KEYS = "1234567890!@#$%^&*()-_+=/\\{}[]<>;:\"`|~£¥"
 
const float KEY_SPACING = 4f
 
const float KEY_WIDTH = 48f
 
const float KEY_HEIGHT = 37f
 
static readonly RasterizerState OverflowHiddenRasterizerState
 
static int _idCounter = 0
 

Detailed Description

Definition at line 15 of file UIVirtualKeyboard.cs.


The documentation for this class was generated from the following file: