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

◆ Draw()

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

Implements Terraria.GameContent.Animations.IAnimationSegment.

Definition at line 466 of file Segments.cs.

467 {
468 int num = info.TimeInAnimation - _targetTime;
469 if (num < 0 || (float)num >= DedicatedTimeNeeded)
470 {
471 return;
472 }
473 Vector2 vec = info.AnchorPositionOnScreen + _offset + _velocity * num;
474 vec = vec.Floor();
475 bool flag = num < 6 || (float)num >= DedicatedTimeNeeded - 6f;
476 Texture2D value = TextureAssets.Extra[48].Value;
477 Rectangle value2 = value.Frame(8, EmoteBubble.EMOTE_SHEET_VERTICAL_FRAMES, (!flag) ? 1 : 0);
478 Vector2 origin = new Vector2(value2.Width / 2, value2.Height);
480 info.SpriteBatch.Draw(value, vec, value2, Color.White * info.DisplayOpacity, 0f, origin, 1f, spriteEffects, 0f);
481 if (!flag)
482 {
483 int emoteId = _emoteId;
484 if ((emoteId == 87 || emoteId == 89) && spriteEffects.HasFlag(SpriteEffects.FlipHorizontally))
485 {
486 spriteEffects &= ~SpriteEffects.FlipHorizontally;
487 vec.X += 4f;
488 }
489 info.SpriteBatch.Draw(value, vec, GetFrame(num % 20), Color.White, 0f, origin, 1f, spriteEffects, 0f);
490 }
491 }
static readonly int EMOTE_SHEET_VERTICAL_FRAMES

References Terraria.GameContent.Animations.Segments.EmoteSegment._effect, Terraria.GameContent.Animations.Segments.EmoteSegment._emoteId, Terraria.GameContent.Animations.Segments.EmoteSegment._offset, Terraria.GameContent.Animations.Segments.EmoteSegment._targetTime, Terraria.GameContent.Animations.Segments.EmoteSegment._velocity, Terraria.GameContent.Animations.Segments.EmoteSegment.DedicatedTimeNeeded, Terraria.GameContent.UI.EmoteBubble.EMOTE_SHEET_VERTICAL_FRAMES, Terraria.GameContent.TextureAssets.Extra, Terraria.GameContent.Animations.Segments.EmoteSegment.GetFrame(), Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Color.White.