Skip to content

Particle Configuration

Particles have many configuration options, which can be set in ParticleConfig. This configuration can then be used to create and add a new particle to the particle system.

The particle configuration is defined like this.

public class ParticleConfig
{
    /// <summary>
    /// Set the position of the particle. 
    /// </summary>
    public Vector2 Position { get; set; }

    /// <summary>
    /// Set the particle lifespan in seconds. 
    /// </summary>
    public float Life { get; set; }

    /// <summary>
    /// Set the particle moving direction in degrees. 
    /// </summary>
    public float Angle { get; set; }

    /// <summary>
    /// Set the particle speed in pixels per second. 
    /// </summary>
    public float Speed { get; set; }

    /// <summary>
    /// Set the radial acceleration towards the rotation axis. 
    /// </summary>
    public float RadialAcceleration { get; set; }

    /// <summary>
    /// Set the tangential acceleration around the rotation axis. 
    /// </summary>
    public float TangentialAcceleration { get; set; }

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

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

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

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

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

    /// <summary>
    /// Maximum possible lifespan of a particle.
    /// </summary>
    public static float MaxLife = float.MaxValue;
}

Read more: