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

◆ DrawLantern()

void Terraria.GameContent.Skies.LanternSky.DrawLantern ( SpriteBatch spriteBatch,
Lantern lantern,
Color opacity,
Vector2 depthScale,
Vector2 position,
float alpha )
inlineprivate

Definition at line 243 of file LanternSky.cs.

244 {
245 float y = (Main.GlobalTimeWrappedHourly % 6f / 6f * ((float)Math.PI * 2f)).ToRotationVector2().Y;
246 float num = y * 0.2f + 0.8f;
247 Color color = new Color(255, 255, 255, 0) * _opacity * alpha * num * 0.4f;
248 for (float num2 = 0f; num2 < 1f; num2 += 1f / 3f)
249 {
250 Vector2 vector = new Vector2(0f, 2f).RotatedBy((float)Math.PI * 2f * num2 + lantern.Rotation) * y;
251 spriteBatch.Draw(lantern.Texture, position + vector, lantern.GetSourceRectangle(), color, lantern.Rotation, lantern.GetSourceRectangle().Size() / 2f, depthScale.X * 2f, SpriteEffects.None, 0f);
252 }
253 spriteBatch.Draw(lantern.Texture, position, lantern.GetSourceRectangle(), opacity * _opacity, lantern.Rotation, lantern.GetSourceRectangle().Size() / 2f, depthScale.X * 2f, SpriteEffects.None, 0f);
254 }
void Draw(Texture2D texture, Vector2 position, Color color)
const double PI
Definition Math.cs:16

References Terraria.GameContent.Skies.LanternSky._opacity, Microsoft.Xna.Framework.Graphics.Color, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.GameContent.Skies.LanternSky.Lantern.GetSourceRectangle(), System.Math.PI, Terraria.GameContent.Skies.LanternSky.Lantern.Rotation, Terraria.GameContent.Skies.LanternSky.Lantern.Texture, Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Vector2.X.

Referenced by Terraria.GameContent.Skies.LanternSky.Draw().