Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ABasicParticle.cs
Go to the documentation of this file.
4
6
7public abstract class ABasicParticle : IPooledParticle, IParticle
8{
10
12
14
16
17 protected Rectangle _frame;
18
19 protected Vector2 _origin;
20
21 public float Rotation;
22
23 public float RotationVelocity;
24
26
27 public Vector2 Scale;
28
30
32
33 public bool ShouldBeRemovedFromRenderer { get; protected set; }
34
35 public bool IsRestingInPool { get; private set; }
36
46
47 public virtual void SetBasicInfo(Asset<Texture2D> textureAsset, Rectangle? frame, Vector2 initialVelocity, Vector2 initialLocalPosition)
48 {
49 _texture = textureAsset;
50 _frame = (frame.HasValue ? frame.Value : _texture.Frame());
51 _origin = _frame.Size() / 2f;
52 Velocity = initialVelocity;
53 LocalPosition = initialLocalPosition;
55 }
56
66
67 public abstract void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch);
68
69 public void RestInPool()
70 {
71 IsRestingInPool = true;
72 }
73
91}
virtual void Update(ref ParticleRendererSettings settings)
void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch)
virtual void SetBasicInfo(Asset< Texture2D > textureAsset, Rectangle? frame, Vector2 initialVelocity, Vector2 initialLocalPosition)