tModLoader v2024.11
A mod to make and play Terraria mods
UICommon Class Reference

Static Public Member Functions

static void AddOrRemoveChild (this UIElement elem, UIElement child, bool add)
 
static void DrawHoverStringInBounds (SpriteBatch spriteBatch, string text, Rectangle? bounds=null)
 
static void TooltipMouseText (string text)
 Draws a tooltip on the mouse cursor. Functions like Main.MouseText(string, int, byte, int, int, int, int, int) and Main.hoverItemName, but adds the same background seen in item tooltips behind the text. More...
 
static T WithFadedMouseOver< T > (this T elem, Color overColor=default, Color outColor=default, Color overBorderColor=default, Color outBorderColor=default)
 
static T WithPadding< T > (this T elem, float pixels)
 
static T WithPadding< T > (this T elem, string name, int id, Vector2? anchor=null, Vector2? offset=null)
 
static T WithView< T > (this T elem, float viewSize, float maxViewSize)
 

Static Public Attributes

static Color DefaultUIBlue = new Color(73, 94, 171)
 
static Color DefaultUIBlueMouseOver = new Color(63, 82, 151) * 0.7f
 
static Color DefaultUIBorder = Color.Black
 
static Color DefaultUIBorderMouseOver = Colors.FancyUIFatButtonMouseOver
 
static Color MainPanelBackground = new Color(33, 43, 79) * 0.8f
 
static StyleDimension MaxPanelWidth = new StyleDimension(600, 0)
 

Properties

static Asset< Texture2D > ButtonCollapsedTexture [get, set]
 
static Asset< Texture2D > ButtonConfigTexture [get, set]
 
static Asset< Texture2D > ButtonDepsTexture [get, set]
 
static Asset< Texture2D > ButtonDowngradeTexture [get, set]
 
static Asset< Texture2D > ButtonDownloadMultipleTexture [get, set]
 
static Asset< Texture2D > ButtonDownloadTexture [get, set]
 
static Asset< Texture2D > ButtonErrorTexture [get, set]
 
static Asset< Texture2D > ButtonExclamationTexture [get, set]
 
static Asset< Texture2D > ButtonExpandedTexture [get, set]
 
static Asset< Texture2D > ButtonModConfigTexture [get, set]
 
static Asset< Texture2D > ButtonModInfoTexture [get, set]
 
static Asset< Texture2D > ButtonOpenFolder [get, set]
 
static Asset< Texture2D > ButtonPlusTexture [get, set]
 
static Asset< Texture2D > ButtonRunTModPorter [get, set]
 
static Asset< Texture2D > ButtonTranslationModTexture [get, set]
 
static Asset< Texture2D > ButtonUpDownTexture [get, set]
 
static Asset< Texture2D > ButtonUpgradeCsproj [get, set]
 
static Asset< Texture2D > ButtonUpgradeLang [get, set]
 
static Asset< Texture2D > ConfigSideIndicatorTexture [get, set]
 
static Asset< Texture2D > CopyCodeButtonTexture [get, set]
 
static Asset< Texture2D > DividerTexture [get, set]
 
static Asset< Texture2D > InfoDisplayPageArrowTexture [get, set]
 
static Asset< Texture2D > InnerPanelTexture [get, set]
 
static Asset< Texture2D > LoaderBgTexture [get, set]
 
static Asset< Texture2D > LoaderTexture [get, set]
 
static Asset< Texture2D > ModBrowserIconsTexture [get, set]
 
static Asset< Texture2D > ModLocationLocalIcon [get, set]
 
static Asset< Texture2D > ModLocationModPackIcon [get, set]
 
static Asset< Texture2D > tModLoaderTitleLinkButtonsTexture [get, set]
 

Member Function Documentation

◆ TooltipMouseText()

static void UICommon.TooltipMouseText ( string  text)
static

Draws a tooltip on the mouse cursor. Functions like Main.MouseText(string, int, byte, int, int, int, int, int) and Main.hoverItemName, but adds the same background seen in item tooltips behind the text.

Parameters
text

◆ WithFadedMouseOver< T >()

static T UICommon.WithFadedMouseOver< T > ( this T  elem,
Color  overColor = default,
Color  outColor = default,
Color  overBorderColor = default,
Color  outBorderColor = default 
)
static
Type Constraints
T :UIPanel 

◆ WithPadding< T >() [1/2]

static T UICommon.WithPadding< T > ( this T  elem,
float  pixels 
)
static
Type Constraints
T :UIElement 

◆ WithPadding< T >() [2/2]

static T UICommon.WithPadding< T > ( this T  elem,
string  name,
int  id,
Vector2?  anchor = null,
Vector2?  offset = null 
)
static
Type Constraints
T :UIElement 

◆ WithView< T >()

static T UICommon.WithView< T > ( this T  elem,
float  viewSize,
float  maxViewSize 
)
static
Type Constraints
T :UIScrollbar