I have some code that works fine when drawing in the terraria inventory, however for some reason it draws with a pretty big offset in recipe browser.
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
float sizeLimit = 34;
int numberOfCloneImages = 6;
Main.DrawItemIcon(spriteBatch, Item, position, Color.White * 0.7f, sizeLimit);
for (float i = 0; i < 1; i += 1f / numberOfCloneImages)
{
float cloneImageDistance = MathF.Cos(Main.GlobalTimeWrappedHourly / 2.4f * MathF.Tau / 2f) + 0.5f;
cloneImageDistance = MathHelper.Max(cloneImageDistance, 0.3f);
Color color = Color.Purple * 0.4f;
color *= 1f - cloneImageDistance * 0.2f;
color.A = 0;
cloneImageDistance *= 3;
Vector2 drawPos = position + (i * MathF.Tau).ToRotationVector2() * (cloneImageDistance + 2f);
Main.DrawItemIcon(spriteBatch, Item, drawPos, color, sizeLimit);
}
return false;
}
I also should note that I did not write this code myself, it was given to me to use by someone else
(sorry for the weird formatting, I don't really use github so I don't know the optimal way of writing this out)
I have some code that works fine when drawing in the terraria inventory, however for some reason it draws with a pretty big offset in recipe browser.
I also should note that I did not write this code myself, it was given to me to use by someone else (sorry for the weird formatting, I don't really use github so I don't know the optimal way of writing this out)