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

◆ Draw()

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

Definition at line 304 of file Segments.cs.

305 {
306 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
307 if ((float)info.TimeInAnimation > (float)_targetTime + base.DedicatedTimeNeeded || info.TimeInAnimation < _targetTime)
308 {
309 return;
310 }
312 float localTimeForObject = info.TimeInAnimation - _targetTime;
314 if (_npc.alpha < 255)
315 {
316 _npc.FindFrame();
317 if (TownNPCProfiles.Instance.GetProfile(_npc, out var profile))
318 {
319 TextureAssets.Npc[_npc.type] = profile.GetTextureNPCShouldUse(_npc);
320 }
321 _npc.Opacity *= info.DisplayOpacity;
322 Main.instance.DrawNPCDirect(info.SpriteBatch, _npc, _npc.behindTiles, Vector2.Zero);
323 }
324 }
void ResetNPCAnimation(ref GameAnimationSegment info)
Definition Segments.cs:326
void FindFrame()
Definition NPC.cs:72151
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
int alpha
0 is opaque, and 255 is transparent. Note that this is the opposite of how alpha is typically express...
Definition NPC.cs:1092
bool behindTiles
Indicates that this NPC draws behind solid tiles. See ExampleDrawBehindNPCfor examples of how to us...
Definition NPC.cs:1149

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(), and Terraria.NPC.type.

+ Here is the call graph for this function: