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

◆ Draw()

override void Terraria.GameContent.Animations.Segments.NPCSegment.Draw ( ref GameAnimationSegment info)
inline

Definition at line 244 of file Segments.cs.

245 {
246 if ((float)info.TimeInAnimation > (float)_targetTime + base.DedicatedTimeNeeded || info.TimeInAnimation < _targetTime)
247 {
248 return;
249 }
251 float localTimeForObject = info.TimeInAnimation - _targetTime;
253 if (_npc.alpha < 255)
254 {
255 _npc.FindFrame();
256 if (TownNPCProfiles.Instance.GetProfile(_npc.type, out var profile))
257 {
258 TextureAssets.Npc[_npc.type] = profile.GetTextureNPCShouldUse(_npc);
259 }
260 _npc.Opacity *= info.DisplayOpacity;
261 Main.instance.DrawNPCDirect(info.SpriteBatch, _npc, _npc.behindTiles, Vector2.Zero);
262 }
263 }
void ResetNPCAnimation(ref GameAnimationSegment info)
Definition Segments.cs:265
void FindFrame()
Definition NPC.cs:59052
int type
Definition NPC.cs:445
int alpha
Definition NPC.cs:489
bool behindTiles
Definition NPC.cs:519

References Terraria.GameContent.Animations.Segments.NPCSegment._npc, Terraria.GameContent.Animations.Segments.AnimationSegmentWithActions< NPC >._targetTime, Terraria.NPC.alpha, Terraria.NPC.behindTiles, Terraria.NPC.FindFrame(), Terraria.GameContent.TownNPCProfiles.Instance, Terraria.Main.instance, Terraria.GameContent.TextureAssets.Npc, Terraria.GameContent.Animations.Segments.AnimationSegmentWithActions< NPC >.ProcessActions(), Terraria.GameContent.Animations.Segments.NPCSegment.ResetNPCAnimation(), Terraria.NPC.type, and Microsoft.Xna.Framework.Vector2.Zero.