tModLoader v2025.06
A mod to make and play Terraria mods
Animation Class Reference

Public Member Functions

record AnimationFrameData (int frameRate, int[] frames)
 
void Update ()
 

Static Public Member Functions

static bool GetTemporaryFrame (int x, int y, out int frameData)
 Gets the frame value of the temporary tile animation at the provided tile coordinates. Returns false if there is no animation.
 
static void Initialize ()
 
static void NewTemporaryAnimation (int type, ushort tileType, int x, int y)
 Starts a temporary tile animation of the given type at the given tile coordinates. tileType should match the current Tile.TileType. This method should be called on the server in multiplayer to properly sync.
 
static int RegisterTemporaryAnimation (int frameRate, int[] frames)
 Registers a temporary tile animation are returns a unique ID. The animation will play through the provided frames and the provided frameRate. Use the ID with NewTemporaryAnimation to trigger and sync the tempory tile animation. More...
 
static void Unload ()
 
static void UpdateAll ()
 

Static Public Attributes

static Dictionary< int, AnimationFrameData > AnimationFrameDatas = new()
 

Properties

static int AnimationCount = 5 [get]
 

Member Function Documentation

◆ RegisterTemporaryAnimation()

static int Animation.RegisterTemporaryAnimation ( int  frameRate,
int[]  frames 
)
static

Registers a temporary tile animation are returns a unique ID. The animation will play through the provided frames and the provided frameRate. Use the ID with NewTemporaryAnimation to trigger and sync the tempory tile animation.

Returns
A unique Id for this specific animation.