tModLoader v2023.01
A mod to make and play Terraria mods
Terraria.UI.UIElement Class Reference

Inherits IComparable.

Inherited by Terraria.GameContent.UI.Elements.EmoteButton, Terraria.GameContent.UI.Elements.EmotesGroupListItem, Terraria.GameContent.UI.Elements.GroupOptionButton< T >, Terraria.GameContent.UI.Elements.PowerStripUIElement, Terraria.GameContent.UI.Elements.UIBestiaryEntryButton, Terraria.GameContent.UI.Elements.UIBestiaryEntryGrid, Terraria.GameContent.UI.Elements.UIBestiaryEntryIcon, Terraria.GameContent.UI.Elements.UIBestiaryInfoLine< T >, Terraria.GameContent.UI.Elements.UIBestiaryNPCEntryPortrait, Terraria.GameContent.UI.Elements.UICharacter, Terraria.GameContent.UI.Elements.UICharacterNameButton, Terraria.GameContent.UI.Elements.UIClothStyleButton, Terraria.GameContent.UI.Elements.UIColoredImageButton, Terraria.GameContent.UI.Elements.UIColoredSliderSimple, Terraria.GameContent.UI.Elements.UICreativeInfiniteItemsDisplay, Terraria.GameContent.UI.Elements.UICreativeItemsInfiniteFilteringOptions, Terraria.GameContent.UI.Elements.UICreativePowerButton, Terraria.GameContent.UI.Elements.UIDifficultyButton, Terraria.GameContent.UI.Elements.UIDynamicItemCollection, Terraria.GameContent.UI.Elements.UIGenProgressBar, Terraria.GameContent.UI.Elements.UIHeader, Terraria.GameContent.UI.Elements.UIHorizontalSeparator, Terraria.GameContent.UI.Elements.UIIconTextButton, Terraria.GameContent.UI.Elements.UIImage, Terraria.GameContent.UI.Elements.UIImageButton, Terraria.GameContent.UI.Elements.UIImageFramed, Terraria.GameContent.UI.Elements.UIItemIcon, Terraria.GameContent.UI.Elements.UIItemSlot, Terraria.GameContent.UI.Elements.UIKeybindingListItem, Terraria.GameContent.UI.Elements.UIKeybindingSimpleListItem, Terraria.GameContent.UI.Elements.UIKeybindingSliderItem, Terraria.GameContent.UI.Elements.UIKeybindingToggleListItem, Terraria.GameContent.UI.Elements.UIList, Terraria.GameContent.UI.Elements.UIList, Terraria.GameContent.UI.Elements.UIPanel, Terraria.GameContent.UI.Elements.UIParticleLayer, Terraria.GameContent.UI.Elements.UIProgressBar, Terraria.GameContent.UI.Elements.UIScrollbar, Terraria.GameContent.UI.Elements.UIScrollbar, Terraria.GameContent.UI.Elements.UISearchBar, Terraria.GameContent.UI.Elements.UISlicedImage, Terraria.GameContent.UI.Elements.UISliderBase, Terraria.GameContent.UI.Elements.UIText, Terraria.GameContent.UI.Elements.UIToggleImage, Terraria.GameContent.UI.Elements.UIVerticalSeparator, Terraria.GameContent.UI.Elements.UIWorldCreationPreview, Terraria.GameContent.UI.States.UISortableElement, Terraria.ModLoader.Config.UI.ConfigElement< T >, Terraria.ModLoader.Config.UI.DefinitionOptionElement< T >, Terraria.ModLoader.Config.UI.HeaderElement, Terraria.ModLoader.UI.Elements.UIGrid, Terraria.ModLoader.UI.UIBestiaryBar, Terraria.ModLoader.UI.UICycleImage, Terraria.ModLoader.UI.UIFocusInputTextField, Terraria.ModLoader.UI.UIInputTextField, Terraria.ModLoader.UI.UILoaderAnimatedImage, Terraria.ModLoader.UI.UIMemoryBar, Terraria.ModLoader.UI.UIModStateText, and Terraria.UI.UIState.

Public Member Functions

void Activate ()
 
void Append (UIElement element)
 
virtual void Click (UIMouseEvent evt)
 
virtual int CompareTo (object obj)
 
virtual bool ContainsPoint (Vector2 point)
 
void CopyStyle (UIElement element)
 
void Deactivate ()
 
virtual void DoubleClick (UIMouseEvent evt)
 
virtual void Draw (SpriteBatch spriteBatch)
 
void DrawDebugHitbox (BasicDebugDrawer drawer, float colorIntensity=0f)
 
delegate void ElementEvent (UIElement affectedElement)
 
virtual void ExecuteRecursively (UIElementAction action)
 
Rectangle GetClippingRectangle (SpriteBatch spriteBatch)
 
CalculatedStyle GetDimensions ()
 
UIElement GetElementAt (Vector2 point)
 
CalculatedStyle GetInnerDimensions ()
 
CalculatedStyle GetOuterDimensions ()
 
bool GetSnapPoint (out SnapPoint point)
 
virtual List< SnapPointGetSnapPoints ()
 
virtual Rectangle GetViewCullingArea ()
 
bool HasChild (UIElement child)
 
void Initialize ()
 
virtual void MiddleClick (UIMouseEvent evt)
 
virtual void MiddleDoubleClick (UIMouseEvent evt)
 
virtual void MiddleMouseDown (UIMouseEvent evt)
 
virtual void MiddleMouseUp (UIMouseEvent evt)
 
virtual void MouseDown (UIMouseEvent evt)
 
delegate void MouseEvent (UIMouseEvent evt, UIElement listeningElement)
 
virtual void MouseOut (UIMouseEvent evt)
 
virtual void MouseOver (UIMouseEvent evt)
 
virtual void MouseUp (UIMouseEvent evt)
 
virtual void OnActivate ()
 
virtual void OnDeactivate ()
 
virtual void OnInitialize ()
 
virtual void Recalculate ()
 
virtual void RecalculateChildren ()
 
void Remove ()
 
void RemoveAllChildren ()
 
void RemoveChild (UIElement child)
 
virtual void RightClick (UIMouseEvent evt)
 
virtual void RightDoubleClick (UIMouseEvent evt)
 
virtual void RightMouseDown (UIMouseEvent evt)
 
virtual void RightMouseUp (UIMouseEvent evt)
 
virtual void ScrollWheel (UIScrollWheelEvent evt)
 
delegate void ScrollWheelEvent (UIScrollWheelEvent evt, UIElement listeningElement)
 
void SetPadding (float pixels)
 
void SetSnapPoint (string name, int id, Vector2? anchor=null, Vector2? offset=null)
 
delegate void UIElementAction (UIElement element)
 
virtual void Update (GameTime gameTime)
 
virtual void XButton1Click (UIMouseEvent evt)
 
virtual void XButton1DoubleClick (UIMouseEvent evt)
 
virtual void XButton1MouseDown (UIMouseEvent evt)
 
virtual void XButton1MouseUp (UIMouseEvent evt)
 
virtual void XButton2Click (UIMouseEvent evt)
 
virtual void XButton2DoubleClick (UIMouseEvent evt)
 
virtual void XButton2MouseDown (UIMouseEvent evt)
 
virtual void XButton2MouseUp (UIMouseEvent evt)
 

Public Attributes

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

Protected Member Functions

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

Protected Attributes

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

Properties

IEnumerable< UIElementChildren [get]
 
bool IsMouseHovering [get]
 
UIElement Parent [get]
 
int UniqueId [get]
 

Events

MouseEvent OnClick
 
MouseEvent OnDoubleClick
 
MouseEvent OnMiddleClick
 
MouseEvent OnMiddleDoubleClick
 
MouseEvent OnMiddleMouseDown
 
MouseEvent OnMiddleMouseUp
 
MouseEvent OnMouseDown
 
MouseEvent OnMouseOut
 
MouseEvent OnMouseOver
 
MouseEvent OnMouseUp
 
MouseEvent OnRightClick
 
MouseEvent OnRightDoubleClick
 
MouseEvent OnRightMouseDown
 
MouseEvent OnRightMouseUp
 
ScrollWheelEvent OnScrollWheel
 
ElementEvent OnUpdate
 
MouseEvent OnXButton1Click
 
MouseEvent OnXButton1DoubleClick
 
MouseEvent OnXButton1MouseDown
 
MouseEvent OnXButton1MouseUp
 
MouseEvent OnXButton2Click
 
MouseEvent OnXButton2DoubleClick
 
MouseEvent OnXButton2MouseDown
 
MouseEvent OnXButton2MouseUp