Decimation_Mod/Content/Debug/DebugUtils.cs
2020-06-05 12:42:17 -04:00

25 lines
772 B
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
namespace Decimation.Content.Debug
{
public static class DebugUtils
{
public static void DrawDebugHitbox(this NPC npc, SpriteBatch spriteBatch)
{
Texture2D debugTexture = Decimation.Instance.GetTexture("Content/Debug/pixel");
spriteBatch.Draw(
debugTexture,
new Rectangle(
(int) (npc.position.X - Main.screenPosition.X),
(int) (npc.position.Y - Main.screenPosition.Y),
(int) (npc.width * npc.scale),
(int) (npc.height * npc.scale)
),
new Color(255, 0, 0, 20)
);
}
}
}