Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetDrawHitbox()

static Rectangle Terraria.Item.GetDrawHitbox ( int type,
Player user )
inlinestatic

Definition at line 49662 of file Item.cs.

49663 {
49664 if (Main.dedServ)
49665 {
49666 return Rectangle.Empty;
49667 }
49668 Main.instance.LoadItem(type);
49669 if (ItemID.Sets.IsFood[type])
49670 {
49671 return TextureAssets.Item[type].Frame(1, 3, 0, 1);
49672 }
49673 switch (type)
49674 {
49675 case 75:
49676 return TextureAssets.Item[type].Frame(1, 8);
49677 case 520:
49678 case 521:
49679 case 547:
49680 case 548:
49681 case 549:
49682 case 575:
49683 case 3453:
49684 case 3454:
49685 case 3455:
49686 case 3580:
49687 case 3581:
49688 case 4068:
49689 case 4069:
49690 case 4070:
49691 return TextureAssets.Item[type].Frame(1, 4);
49692 default:
49693 return TextureAssets.Item[type].Frame();
49694 }
49695 }
static Asset< Texture2D >[] Item
static bool[] IsFood
Definition ItemID.cs:233

References Terraria.Main.dedServ, Microsoft.Xna.Framework.Rectangle.Empty, Terraria.Main.instance, Terraria.ID.ItemID.Sets.IsFood, Terraria.GameContent.TextureAssets.Item, and Terraria.Item.type.

Referenced by Terraria.Main.DrawInterface_40_InteractItemIcon(), Terraria.Main.DrawMouseOver(), Terraria.Player.ItemCheck(), and Terraria.Player.PlayerFrame().