tModLoader I HAVE PROBLEMS TO ANIMATE MY ITEM

Lopezito

Skeletron Prime
well....
i create a sprite with 4 frames but i dont know how i can animate it
if someone can help me I would really appreciate it
 

Attachments

  • SoulofRules.cs
    683 bytes · Views: 260
  • SoulofRules.png
    SoulofRules.png
    1.3 KB · Views: 557
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

namespace YOURMOD.Items
{
    public class YOURITEM : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("ITEM NAME");
            Tooltip.SetDefault("'TOOLTIP.'");
            Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4));
            ItemID.Sets.AnimatesAsSoul[item.type] = true;
            ItemID.Sets.ItemIconPulse[item.type] = true;
            ItemID.Sets.ItemNoGravity[item.type] = true;
        }
        
        public override void SetDefaults()
        {
            item.width = 20;
            item.height = 20;
            item.maxStack = 9999;
            item.value = 0;
            item.rare = 6;
        }
    }
}

If this is a soul this should work
 
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

namespace YOURMOD.Items
{
    public class YOURITEM : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("ITEM NAME");
            Tooltip.SetDefault("'TOOLTIP.'");
            Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4));
            ItemID.Sets.AnimatesAsSoul[item.type] = true;
            ItemID.Sets.ItemIconPulse[item.type] = true;
            ItemID.Sets.ItemNoGravity[item.type] = true;
        }
       
        public override void SetDefaults()
        {
            item.width = 20;
            item.height = 20;
            item.maxStack = 9999;
            item.value = 0;
            item.rare = 6;
        }
    }
}

If this is a soul this should work

Oh thanks but I've already solved it
:) But thanks xD
[doublepost=1561570469,1561570391][/doublepost]
Random question, please - What does the 5 in (5, 4) do? It's a four-frame thing.

Really idk but i want to know too lol
 
It is? o.o Wow, that's .. .. .. huh. That's a difficult concept to grasp. >.> Thank you for the response, but I'm afraid it went way over my head. Those sprites look way taller and wider than five pixels.
 
I know this thread is very old and I'm sorry for posting on it, but if anyone is looking at this for info in the present, the 5 is the amount of ticks per frame, and the 4 is the amount of frames in the animation. Hope this helps!
Thank you!
 
I know this thread is very old and I'm sorry for posting on it, but if anyone is looking at this for info in the present, the 5 is the amount of ticks per frame, and the 4 is the amount of frames in the animation. Hope this helps!
Hm isn't 5 is speed in ticks and 4 is frames in animation? And sorry for necroing.
 
Back
Top Bottom