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

◆ Draw()

void Terraria.GameContent.Golf.FancyGolfPredictionLine.Draw ( Camera camera,
SpriteBatch spriteBatch,
float chargeProgress )
inline

Definition at line 60 of file FancyGolfPredictionLine.cs.

61 {
62 _drawer.Begin(camera.GameViewMatrix.TransformationMatrix);
64 Texture2D value = TextureAssets.Extra[33].Value;
65 Vector2 vector = new Vector2(3.5f, 3.5f);
66 Vector2 origin = value.Size() / 2f;
67 Vector2 vector2 = vector - camera.UnscaledPosition;
68 float num = 0f;
69 float num2 = 0f;
70 for (int i = 0; i < _positions.Count - 1; i++)
71 {
73 if (length != 0f)
74 {
75 for (; num < num2 + length; num += 4f)
76 {
77 float num3 = (num - num2) / length + (float)i;
78 Vector2 position = GetPosition((num - num2) / length + (float)i);
79 Color color = GetColor2(num3);
80 color *= MathHelper.Clamp(2f - 2f * num3 / (float)(_positions.Count - 1), 0f, 1f);
81 spriteBatch.Draw(value, position + vector2, null, color, 0f, origin, GetScale(num), SpriteEffects.None, 0f);
82 }
83 num2 += length;
84 }
85 }
86 _drawer.End();
87 }
void Draw(Texture2D texture, Vector2 position, Color color)
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
void GetSectionLength(int startIndex, out float length, out float rotation)

References Terraria.GameContent.Golf.FancyGolfPredictionLine._drawer, Terraria.GameContent.Golf.FancyGolfPredictionLine._positions, ReLogic.Graphics.BasicDebugDrawer.Begin(), Microsoft.Xna.Framework.MathHelper.Clamp(), System.Collections.Generic.List< T >.Count, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), ReLogic.Graphics.BasicDebugDrawer.End(), Terraria.GameContent.TextureAssets.Extra, Terraria.GameContent.Golf.FancyGolfPredictionLine.GetColor2(), Terraria.GameContent.Golf.FancyGolfPredictionLine.GetPosition(), Terraria.GameContent.Golf.FancyGolfPredictionLine.GetScale(), Terraria.GameContent.Golf.FancyGolfPredictionLine.GetSectionLength(), System.length, System.value, and Microsoft.Xna.Framework.Graphics.Vector2.