Struct Particles2D
2D particle emitter.
struct Particles2D
;
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.
Properties
Name | Type | Description |
---|---|---|
amount [get, set]
|
long | Number of particles emitted in one emission cycle. |
drawOrder [get, set]
|
Particles2D | Particle draw order. Uses draworder values.
|
emitting [get, set]
|
bool | If true , particles are being emitted.
|
explosiveness [get, set]
|
double | 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.
|
fixedFps [get, set]
|
long | 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. |
fractDelta [get, set]
|
bool | If true , results in fractional delta calculation which has a smoother particles display effect.
|
lifetime [get, set]
|
double | Amount of time each particle will exist. |
localCoords [get, set]
|
bool | If true , particles use the parent node's coordinate space. If false , they use global coordinates.
|
normalMap [get, set]
|
Texture | Normal map to be used for the texture property.
|
oneShot [get, set]
|
bool | If true , only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle's end.
|
preprocess [get, set]
|
double | Particle system starts as if it had already run for this many seconds. |
randomness [get, set]
|
double | Emission lifetime randomness ratio. |
speedScale [get, set]
|
double | Particle system's running speed scaling ratio. A value of 0 can be used to pause the particles.
|
texture [get, set]
|
Texture | Particle texture. If null , particles will be squares.
|
visibilityRect [get, set]
|
Rect2 | Editor visibility helper. |
Methods
Name | Description |
---|---|
captureRect
|
Returns a rectangle containing the positions of all existing particles. |
getAmount
|
|
getDrawOrder
|
|
getExplosivenessRatio
|
|
getFixedFps
|
|
getFractionalDelta
|
|
getLifetime
|
|
getNormalMap
|
|
getOneShot
|
|
getPreProcessTime
|
|
getProcessMaterial
|
|
getRandomnessRatio
|
|
getSpeedScale
|
|
getTexture
|
|
getUseLocalCoordinates
|
|
getVisibilityRect
|
|
isEmitting
|
|
restart
|
Restarts all the existing particles. |
setAmount
|
|
setDrawOrder
|
|
setEmitting
|
|
setExplosivenessRatio
|
|
setFixedFps
|
|
setFractionalDelta
|
|
setLifetime
|
|
setNormalMap
|
|
setOneShot
|
|
setPreProcessTime
|
|
setProcessMaterial
|
|
setRandomnessRatio
|
|
setSpeedScale
|
|
setTexture
|
|
setUseLocalCoordinates
|
|
setVisibilityRect
|
Enums
Name | Description |
---|---|
Constants
|
|
DrawOrder
|