Example #1
0
 public Particle(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, ParticleState state, float theta = 0) : base(position, scale, theta)
 {
     Texture  = texture;
     Tint     = tint;
     Duration = duration;
     LifeTime = 1.0f;
     State    = state;
 }
Example #2
0
 public void Set(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, ParticleState state, float theta = 0)
 {
     Texture     = texture;
     Position    = position;
     Tint        = tint;
     Duration    = duration;
     Scale       = scale;
     LifeTime    = 1.0f;
     State       = state;
     Orientation = theta;
 }
Example #3
0
        public void Create(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, ParticleState state, float theta = 0.0f)
        {
            Particle p;

            if (Particles.Count == Particles.Capacity)
            {
                p = Particles[0];
                Particles.Start++;
            }
            else
            {
                p = Particles[Particles.Count];
                Particles.Count++;
            }

            p.Set(texture, position, tint, duration, scale, state, theta);
        }