Example #1
0
        public ParticleEmitter(Texture texture, ParticleStateInitializer initializer = null)
        {
            if (texture.Disposed)
            {
                throw new ArgumentException("Texture provided was already disposed.", nameof(texture));
            }

            Texture             = texture;
            Texture.UseBlending = true;
            Texture.SetBlendingMode(BlendingPreset.NormalAddAlpha);

            _stateIntegrators = new List <ParticleStateIntegrator>();
            _particles        = new List <Particle>(1200);

            ParticleStateInitializer = initializer ?? new RandomizedStateInitializer(this);
        }
Example #2
0
 protected virtual void CreateParticle()
 {
     _particles.Add(ParticleStateInitializer.CreateParticle());
 }