Skip to content

Particle Emitter Configuration

Particle emitters continually generate particles in a particle system. The configuration of a particle emitter exposes many configuration options of particles. However, this configuration allows to specify a range for many of these options to create particle emitters with a defined random scope. Randomness is a key trait in particle systems, making them more dynamic.

The particle emitter configuration is defined like this.

public class ParticleEmitterConfig
{
    /// <summary>
    /// Set the position of the particle emitter in the system.
    /// </summary>
    public Vector2 Position { get; set; }

    /// <summary>
    /// The emission rate of a particle emitter defines how many particles it generates per second.
    /// </summary>
    public float EmissionRate { get; set; }

    /// <summary>
    /// Set a range for the particle moving direction.
    /// </summary>
    public Range<float> Angle { get; set; }

    /// <summary>
    /// Set a range for the particle speed.
    /// </summary>
    public Range<float> Speed { get; set; }

    /// <summary>
    /// Set a range for the particle life in seconds.
    /// </summary>
    public Range<float> Life { get; set; }

    /// <summary>
    /// Set the range for the particles radial acceleration.
    /// </summary>
    public Range<float> RadialAcceleration { get; set; }

    /// <summary>
    /// Set the range for the particles tangential acceleration.
    /// </summary>
    public Range<float> TangentialAcceleration { get; set; }

    /// <summary>
    /// Set the position of the particles rotation axis.
    /// </summary>
    public Vector2 AxisPosition { get; set; }

    /// <summary>
    /// Set the color at the beginning of a particles lifespan.
    /// </summary>
    public SKColor BeginColor { get; set; }

    /// <summary>
    /// Set the color at the end of a particles lifespan.
    /// </summary>
    public SKColor EndColor { get; set; }

    /// <summary>
    /// Set the size at the beginning of a particles lifespan. 
    /// </summary>
    public Range<float> BeginSize { get; set; }

    /// <summary>
    /// Set the size at the end of a particles lifespan. 
    /// </summary>
    public Range<float> EndSize { get; set; }

    /// <summary>
    /// Enable transition from BeginSize to EndSize during particles lifespan.
    /// </summary>
    public bool EnableSizeTransition { get; set; }

    /// <summary>
    /// Enable transition from BeginColor to EndColor during particles lifespan.
    /// </summary>
    public bool EnableColorTransition { get; set; }
}

Read more: