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

◆ GetFrame()

override Rectangle Terraria.DataStructures.DrawAnimationVertical.GetFrame ( Texture2D texture,
int frameCounterOverride = -1 )
inlinevirtual

Reimplemented from Terraria.DataStructures.DrawAnimation.

Definition at line 41 of file DrawAnimationVertical.cs.

42 {
43 if (frameCounterOverride != -1)
44 {
45 int num = frameCounterOverride / TicksPerFrame;
46 int num2 = FrameCount;
47 if (PingPong)
48 {
49 num2 = num2 * 2 - 1;
50 }
51 int num3 = num % num2;
52 if (PingPong && num3 >= FrameCount)
53 {
54 num3 = FrameCount * 2 - 2 - num3;
55 }
56 Rectangle result = texture.Frame(1, FrameCount, 0, num3);
57 result.Height -= 2;
58 return result;
59 }
60 int frameY = Frame;
61 if (PingPong && Frame >= FrameCount)
62 {
63 frameY = FrameCount * 2 - 2 - Frame;
64 }
65 Rectangle result2 = texture.Frame(1, FrameCount, 0, frameY);
66 result2.Height -= 2;
67 return result2;
68 }

References Terraria.DataStructures.DrawAnimation.Frame, Terraria.DataStructures.DrawAnimation.FrameCount, Terraria.DataStructures.DrawAnimationVertical.PingPong, and Terraria.DataStructures.DrawAnimation.TicksPerFrame.