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

◆ DrawTownAttackGun()

virtual void Terraria.ModLoader.ModNPC.DrawTownAttackGun ( ref Texture2D item,
ref Rectangle itemFrame,
ref float scale,
ref int horizontalHoldoutOffset )
inlinevirtual

Allows you to customize how this town NPC's weapon is drawn when this NPC is shooting (this NPC must have an attack type of 1). scale is a multiplier for the item's drawing size, item is the Texture2D instance of the item to be drawn, itemFrame is the section of the texture to draw, and horizontalHoldoutOffset is how far away the item should be drawn from the NPC.
To use an actual item sprite, use.

Main.GetItemDrawFrame(itemTypeHere, out item, out itemFrame); horizontalHoldoutOffset = (int)Main.DrawPlayerItemPos(1f, itemType).X - someOffsetHere

Parameters
item
itemFrame
scale
horizontalHoldoutOffset

Definition at line 840 of file ModNPC.cs.

841 {
842 }