2D particle emitter.
    public class Particles2D : Node2D

2D particle node used to create a variety of particle systems and effects. Particles2D features an emitter that generates some number of particles at a given rate.

Use the process_material property to add a ParticlesMaterial to configure particle appearance and behavior. Alternatively, you can add a ShaderMaterial which will be applied to all particles.

Inheritance Chain

Constructors

    public Particles2D()

Properties

    public int Amount { get; set; }

Number of particles emitted in one emission cycle.

    public DrawOrderEnum DrawOrder { get; set; }

Particle draw order. Uses DRAW_ORDER_* values.

    public bool Emitting { get; set; }

If true, particles are being emitted.

    public float Explosiveness { get; set; }

How rapidly particles in an emission cycle are emitted. If greater than 0, there will be a gap in emissions before the next cycle begins.

    public int FixedFps { get; set; }

The particle system’s frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself.

    public bool FractDelta { get; set; }

If true, results in fractional delta calculation which has a smoother particles display effect.

    public float Lifetime { get; set; }

Amount of time each particle will exist.

    public bool LocalCoords { get; set; }

If true, particles use the parent node’s coordinate space. If false, they use global coordinates.

    public Texture NormalMap { get; set; }

Normal map to be used for the Texture property.

    public bool OneShot { get; set; }

If true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle’s end.

    public float Preprocess { get; set; }

Particle system starts as if it had already run for this many seconds.

    public Material ProcessMaterial { get; set; }

Material for processing particles. Can be a ParticlesMaterial or a ShaderMaterial.

    public float Randomness { get; set; }

Emission lifetime randomness ratio.

    public float SpeedScale { get; set; }

Particle system’s running speed scaling ratio. A value of 0 can be used to pause the particles.

    public Texture Texture { get; set; }

Particle texture. If null, particles will be squares.

    public Rect2 VisibilityRect { get; set; }

Editor visibility helper.

Methods

    public Rect2 CaptureRect()

Returns a rectangle containing the positions of all existing particles.

    [Obsolete("GetAmount is deprecated. Use the Amount property instead.")]
    public int GetAmount()

Getter for Amount

    [Obsolete("GetDrawOrder is deprecated. Use the DrawOrder property instead.")]
    public DrawOrderEnum GetDrawOrder()

Getter for DrawOrder

    [Obsolete("GetExplosivenessRatio is deprecated. Use the Explosiveness property instead.")]
    public float GetExplosivenessRatio()

Getter for Explosiveness

    [Obsolete("GetFixedFps is deprecated. Use the FixedFps property instead.")]
    public int GetFixedFps()

Getter for FixedFps

    [Obsolete("GetFractionalDelta is deprecated. Use the FractDelta property instead.")]
    public bool GetFractionalDelta()

Getter for FractDelta

    [Obsolete("GetLifetime is deprecated. Use the Lifetime property instead.")]
    public float GetLifetime()

Getter for DrawOrderEnum.Lifetime

    [Obsolete("GetNormalMap is deprecated. Use the NormalMap property instead.")]
    public Texture GetNormalMap()

Getter for NormalMap

    [Obsolete("GetOneShot is deprecated. Use the OneShot property instead.")]
    public bool GetOneShot()

Getter for OneShot

    [Obsolete("GetPreProcessTime is deprecated. Use the Preprocess property instead.")]
    public float GetPreProcessTime()

Getter for Preprocess

    [Obsolete("GetProcessMaterial is deprecated. Use the ProcessMaterial property instead.")]
    public Material GetProcessMaterial()

Getter for ProcessMaterial

    [Obsolete("GetRandomnessRatio is deprecated. Use the Randomness property instead.")]
    public float GetRandomnessRatio()

Getter for Randomness

    [Obsolete("GetSpeedScale is deprecated. Use the SpeedScale property instead.")]
    public float GetSpeedScale()

Getter for SpeedScale

    [Obsolete("GetTexture is deprecated. Use the Texture property instead.")]
    public Texture GetTexture()

Getter for Texture

    [Obsolete("GetUseLocalCoordinates is deprecated. Use the LocalCoords property instead.")]
    public bool GetUseLocalCoordinates()

Getter for LocalCoords

    [Obsolete("GetVisibilityRect is deprecated. Use the VisibilityRect property instead.")]
    public Rect2 GetVisibilityRect()

Getter for VisibilityRect

    [Obsolete("IsEmitting is deprecated. Use the Emitting property instead.")]
    public bool IsEmitting()

Getter for Emitting

    public void Restart()

Restarts all the existing particles.

    [Obsolete("SetAmount is deprecated. Use the Amount property instead.")]
    public void SetAmount(int amount)

Setter for Amount

    [Obsolete("SetDrawOrder is deprecated. Use the DrawOrder property instead.")]
    public void SetDrawOrder(DrawOrderEnum order)

Setter for DrawOrder

    [Obsolete("SetEmitting is deprecated. Use the Emitting property instead.")]
    public void SetEmitting(bool emitting)

Setter for Emitting

    [Obsolete("SetExplosivenessRatio is deprecated. Use the Explosiveness property instead.")]
    public void SetExplosivenessRatio(float ratio)

Setter for Explosiveness

    [Obsolete("SetFixedFps is deprecated. Use the FixedFps property instead.")]
    public void SetFixedFps(int fps)

Setter for FixedFps

    [Obsolete("SetFractionalDelta is deprecated. Use the FractDelta property instead.")]
    public void SetFractionalDelta(bool enable)

Setter for FractDelta

    [Obsolete("SetLifetime is deprecated. Use the Lifetime property instead.")]
    public void SetLifetime(float secs)

Setter for DrawOrderEnum.Lifetime

    [Obsolete("SetNormalMap is deprecated. Use the NormalMap property instead.")]
    public void SetNormalMap(Texture texture)

Setter for NormalMap

    [Obsolete("SetOneShot is deprecated. Use the OneShot property instead.")]
    public void SetOneShot(bool secs)

Setter for OneShot

    [Obsolete("SetPreProcessTime is deprecated. Use the Preprocess property instead.")]
    public void SetPreProcessTime(float secs)

Setter for Preprocess

    [Obsolete("SetProcessMaterial is deprecated. Use the ProcessMaterial property instead.")]
    public void SetProcessMaterial(Material material)

Setter for ProcessMaterial

    [Obsolete("SetRandomnessRatio is deprecated. Use the Randomness property instead.")]
    public void SetRandomnessRatio(float ratio)

Setter for Randomness

    [Obsolete("SetSpeedScale is deprecated. Use the SpeedScale property instead.")]
    public void SetSpeedScale(float scale)

Setter for SpeedScale

    [Obsolete("SetTexture is deprecated. Use the Texture property instead.")]
    public void SetTexture(Texture texture)

Setter for Texture

    [Obsolete("SetUseLocalCoordinates is deprecated. Use the LocalCoords property instead.")]
    public void SetUseLocalCoordinates(bool enable)

Setter for LocalCoords

    [Obsolete("SetVisibilityRect is deprecated. Use the VisibilityRect property instead.")]
    public void SetVisibilityRect(Rect2 visibilityRect)

Setter for VisibilityRect

Inner Types

DrawOrderEnum

Name Value Description
Index 0 Particles are drawn in the order emitted.
Lifetime 1 Particles are drawn in order of remaining lifetime.
Tags: