tModLoader v2024.03
A mod to make and play Terraria mods
ResourceOverlayDrawContext Struct Reference

Public Member Functions

 ResourceOverlayDrawContext (PlayerStatsSnapshot snapshot, IPlayerResourcesDisplaySet displaySet, int resourceNumber, Asset< Texture2D > texture)
 Creates a context for drawing resources from a display set More...
 
void Draw ()
 

Public Attributes

Color color
 
SpriteEffects effects
 
Vector2 origin
 The center for rotation and scaling within the source rectangle
 
Vector2 position
 
readonly int resourceNumber
 Which heart/star/bar/panel is being drawn
NOTE: This value usually starts at 0, but it can start at other values
 
float rotation
 
Vector2 scale
 
readonly PlayerStatsSnapshot snapshot
 A snapshot of the player's health and mana stats
 
Rectangle? source
 The slice of the texture to draw
null represents the entire texture
 
Asset< Texture2D > texture
 

Properties

IPlayerResourcesDisplaySet DisplaySet [get]
 The resource display set that this context is drawing from
 
SpriteBatch SpriteBatch [get]
 

Constructor & Destructor Documentation

◆ ResourceOverlayDrawContext()

ResourceOverlayDrawContext.ResourceOverlayDrawContext ( PlayerStatsSnapshot  snapshot,
IPlayerResourcesDisplaySet  displaySet,
int  resourceNumber,
Asset< Texture2D >  texture 
)

Creates a context for drawing resources from a display set

Parameters
snapshotA snapshot of a player's life and mana stats
displaySetThe display set that this context is for
resourceNumberThe resource number within the resource set
textureThe texture being drawn