tModLoader v2024.09
A mod to make and play Terraria mods
PrimitiveRangeElement< T > Class Template Reference

Inherits RangeElement.

Public Member Functions

override void OnBind ()
 
- Public Member Functions inherited from RangeElement
float DrawValueBar (SpriteBatch sb, float scale, float perc, int lockState=0, Utils.ColorLerpMethod colorMethod=null)
 
override void OnBind ()
 
- Public Member Functions inherited from ConfigElement< T >
void Bind (PropertyFieldWrapper memberInfo, object item, IList array, int index)
 Bind must always be called after the ctor and serves to facilitate a convenient inheritance workflow for custom ConfigElemets from mods.
 
virtual void OnBind ()
 
- Public Member Functions inherited from UIElement
void Activate ()
 
void Append (UIElement element)
 
virtual int CompareTo (object obj)
 
virtual bool ContainsPoint (Vector2 point)
 
void CopyStyle (UIElement element)
 
void Deactivate ()
 
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 LeftClick (UIMouseEvent evt)
 
virtual void LeftDoubleClick (UIMouseEvent evt)
 
virtual void LeftMouseDown (UIMouseEvent evt)
 Called when the UIElement under the mouse is left clicked. The default code calls the OnLeftMouseDown event and then calls LeftMouseDown on the Parent element. Since the method is called on all parent elements in the hierarchy, check if (evt.Target == this) for code only interested in direct clicks to this element. Children elements overlaying this element can be ignored by setting IgnoresMouseInteraction to true on them. More...
 
virtual void LeftMouseUp (UIMouseEvent evt)
 
virtual void MiddleClick (UIMouseEvent evt)
 
virtual void MiddleDoubleClick (UIMouseEvent evt)
 
virtual void MiddleMouseDown (UIMouseEvent evt)
 
virtual void MiddleMouseUp (UIMouseEvent evt)
 
delegate void MouseEvent (UIMouseEvent evt, UIElement listeningElement)
 
virtual void MouseOut (UIMouseEvent evt)
 Called once when this UIElement is no longer moused over. Default implementation sets IsMouseHovering to false, calls OnMouseOut event, then calls this same method on the Parent element. Useful for changing visuals to indicate the element is no longer interactable, as is the OnMouseOut event. MouseOver(UIMouseEvent) will be called when it is hovered once again. More...
 
virtual void MouseOver (UIMouseEvent evt)
 Called once when this UIElement becomes moused over (hovered). Default implementation sets IsMouseHovering to true, calls OnMouseOver event, then calls this same method on the Parent element. Useful for changing visuals to indicate the element is interactable, as is the OnMouseOver event. Any code that needs to run as long as the element is hovered should use check IsMouseHovering in Update(GameTime). MouseOut(UIMouseEvent) will be called when it no longer hovered. More...
 
virtual void OnActivate ()
 Called each time this element is activated, which is usually when a UIState is activated via UserInterface.SetState(UIState). Use this to run code to update elements whenever the UI is toggled on. More...
 
virtual void OnDeactivate ()
 
virtual void OnInitialize ()
 Called before the first time this element is activated (see OnActivate). Use this method to create and append other UIElement to this to build a UI. More...
 
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)
 

Protected Member Functions

virtual T GetValue ()
 
virtual void SetValue (object value)
 
- Protected Member Functions inherited from RangeElement
override void DrawSelf (SpriteBatch spriteBatch)
 
- Protected Member Functions inherited from ConfigElement< T >
override void DrawSelf (SpriteBatch spriteBatch)
 
virtual object GetObject ()
 
virtual void SetObject (object value)
 
- Protected Member Functions inherited from UIElement
virtual void DrawChildren (SpriteBatch spriteBatch)
 
virtual void DrawSelf (SpriteBatch spriteBatch)
 

Properties

Increment [get, set]
 
Max [get, set]
 
Min [get, set]
 
IList< T > TList [get, set]
 
- Properties inherited from RangeElement
Utils.ColorLerpMethod ColorMethod [get, set]
 
abstract int NumberTicks [get]
 
abstract float Proportion [get, set]
 
Color SliderColor = Color.White [get, set]
 
abstract float TickIncrement [get]
 
- Properties inherited from ConfigElement< T >
Asset< Texture2DCollapsedTexture = UICommon.ButtonCollapsedTexture [get, set]
 
Asset< Texture2DDeleteTexture = Main.Assets.Request<Texture2D>("Images/UI/ButtonDelete") [get, set]
 
bool DrawLabel = true [get, set]
 
Asset< Texture2DExpandedTexture = UICommon.ButtonExpandedTexture [get, set]
 
int Index [get, set]
 
object Item [get, set]
 
IList List [get, set]
 
PropertyFieldWrapper MemberInfo [get, set]
 
bool NullAllowed [get, set]
 
object OldValue [get, set]
 
Asset< Texture2DPlayTexture = Main.Assets.Request<Texture2D>("Images/UI/ButtonPlay") [get, set]
 
Asset< Texture2DPlusTexture = UICommon.ButtonPlusTexture [get, set]
 
bool ReloadRequired [get, set]
 
bool ShowReloadRequiredTooltip [get, set]
 
Func< string > TooltipFunction [get, set]
 
Asset< Texture2DUpDownTexture = UICommon.ButtonUpDownTexture [get, set]
 
virtual T Value [get, set]
 
bool ValueChanged [get]
 
- Properties inherited from UIElement
IEnumerable< UIElementChildren [get]
 
bool IsMouseHovering [get]
 True when the mouse is hovering over this UIElement. Useful for setting hover tooltips in DrawSelf or drawing hover visual indicators. Note that this is true for all elements in the hierarchy that are hovered, not just the topmost element. For example, hovering over a button that is appended to a panel will mean that IsMouseHovering is true for the button and the panel. Use this or ContainsPoint(Main.MouseScreen) for behaviors that use this logic, such as setting Player.mouseInterface to true.
 
UIElement Parent [get]
 
int UniqueId [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from ConfigElement< T >
static void DrawPanel2 (SpriteBatch spriteBatch, Vector2 position, Texture2D texture, float width, float height, Color color)
 
- Public Attributes inherited from UIElement
float HAlign
 
StyleDimension Height
 
bool IgnoresMouseInteraction
 If true, this element will be ignored for mouse interactions. This can be used to allow UIElement placed over other UIElement to not be the target of mouse clicks. Defaults to false.
 
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 Attributes inherited from ConfigElement< T >
BackgroundColorAttribute BackgroundColorAttribute
 
IncrementAttribute IncrementAttribute
 
JsonDefaultValueAttribute JsonDefaultValueAttribute
 
string Label
 
LabelKeyAttribute LabelAttribute
 
RangeAttribute RangeAttribute
 
TooltipKeyAttribute TooltipAttribute
 
- Protected Attributes inherited from UIElement
readonly List< UIElementElements = new List<UIElement>()
 
- Events inherited from UIElement
MouseEvent OnLeftClick
 
MouseEvent OnLeftDoubleClick
 
MouseEvent OnLeftMouseDown
 
MouseEvent OnLeftMouseUp
 
MouseEvent OnMiddleClick
 
MouseEvent OnMiddleDoubleClick
 
MouseEvent OnMiddleMouseDown
 
MouseEvent OnMiddleMouseUp
 
MouseEvent OnMouseOut
 Called by MouseOut(UIMouseEvent). Use this event instead of inheritance if suitable.
 
MouseEvent OnMouseOver
 Called by MouseOver(UIMouseEvent). Use this event instead of inheritance if suitable.
 
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
 

Member Function Documentation

◆ OnBind()

override void PrimitiveRangeElement< T >.OnBind ( )
virtual

Reimplemented from ConfigElement< T >.