Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FadingParticle.cs
Go to the documentation of this file.
3
5
7{
8 public float FadeInNormalizedTime;
9
10 public float FadeOutNormalizedTime = 1f;
11
13
14 private float _timeTolive;
15
16 private float _timeSinceSpawn;
17
18 public override void FetchFromPool()
19 {
20 base.FetchFromPool();
24 _timeTolive = 0f;
25 _timeSinceSpawn = 0f;
26 }
27
28 public void SetTypeInfo(float timeToLive)
29 {
30 _timeTolive = timeToLive;
31 }
32
33 public override void Update(ref ParticleRendererSettings settings)
34 {
35 base.Update(ref settings);
36 _timeSinceSpawn += 1f;
38 {
39 base.ShouldBeRemovedFromRenderer = true;
40 }
41 }
42
43 public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch)
44 {
46 spritebatch.Draw(_texture.Value, settings.AnchorPosition + LocalPosition, _frame, color, Rotation, _origin, Scale, SpriteEffects.None, 0f);
47 }
48}
void Draw(Texture2D texture, Vector2 position, Color color)
override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch)
override void Update(ref ParticleRendererSettings settings)
static float GetLerpValue(float from, float to, float t, bool clamped=false)
Definition Utils.cs:203