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

NameTypeDescription
amount[get, set] longNumber of particles emitted in one emission cycle.
drawOrder[get, set] Particles2D.DrawOrderParticle draw order. Uses draworder values.
emitting[get, set] boolIf true, particles are being emitted.
explosiveness[get, set] doubleHow 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] longThe 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] boolIf true, results in fractional delta calculation which has a smoother particles display effect.
lifetime[get, set] doubleAmount of time each particle will exist.
localCoords[get, set] boolIf true, particles use the parent node's coordinate space. If false, they use global coordinates.
normalMap[get, set] TextureNormal map to be used for the texture property.
oneShot[get, set] boolIf true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle's end.
preprocess[get, set] doubleParticle system starts as if it had already run for this many seconds.
randomness[get, set] doubleEmission lifetime randomness ratio.
speedScale[get, set] doubleParticle system's running speed scaling ratio. A value of 0 can be used to pause the particles.
texture[get, set] TextureParticle texture. If null, particles will be squares.
visibilityRect[get, set] Rect2Editor visibility helper.

Methods

NameDescription
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

NameDescription
Constants
DrawOrder