Struct CPUParticles2D

CPU-based 2D particle emitter.

struct CPUParticles2D ;

CPU-based 2D particle node used to create a variety of particle systems and effects. See also Particles2D, which provides the same functionality with hardware acceleration, but may not run on older devices.

Properties

NameTypeDescription
amount[get, set] longNumber of particles emitted in one emission cycle.
angle[get, set] doubleInitial rotation applied to each particle, in degrees.
angleCurve[get, set] CurveEach particle's rotation will be animated along this Curve.
angleRandom[get, set] doubleRotation randomness ratio.
angularVelocity[get, set] doubleInitial angular velocity applied to each particle. Sets the speed of rotation of the particle.
angularVelocityCurve[get, set] CurveEach particle's angular velocity will vary along this Curve.
angularVelocityRandom[get, set] doubleAngular velocity randomness ratio.
animOffset[get, set] doubleParticle animation offset.
animOffsetCurve[get, set] CurveEach particle's animation offset will vary along this Curve.
animOffsetRandom[get, set] doubleAnimation offset randomness ratio.
animSpeed[get, set] doubleParticle animation speed.
animSpeedCurve[get, set] CurveEach particle's animation speed will vary along this Curve.
animSpeedRandom[get, set] doubleAnimation speed randomness ratio.
color[get, set] ColorEach particle's initial color. If texture is defined, it will be multiplied by this color.
colorRamp[get, set] GradientEach particle's color will vary along this Gradient.
damping[get, set] doubleThe rate at which particles lose velocity.
dampingCurve[get, set] CurveDamping will vary along this Curve.
dampingRandom[get, set] doubleDamping randomness ratio.
direction[get, set] Vector2Unit vector specifying the particles' emission direction.
drawOrder[get, set] CPUParticles2D.DrawOrderParticle draw order. Uses draworder values.
emissionColors[get, set] PoolArray!(godot.core.color.Color)Sets the Colors to modulate particles by when using constant EMISSION_SHAPE_POINTS or constant EMISSION_SHAPE_DIRECTED_POINTS.
emissionNormals[get, set] PoolArray!(godot.core.vector2.Vector2)Sets the direction the particles will be emitted in when using constant EMISSION_SHAPE_DIRECTED_POINTS.
emissionPoints[get, set] PoolArray!(godot.core.vector2.Vector2)Sets the initial positions to spawn particles when using constant EMISSION_SHAPE_POINTS or constant EMISSION_SHAPE_DIRECTED_POINTS.
emissionRectExtents[get, set] Vector2The rectangle's extents if emissionShape is set to constant EMISSION_SHAPE_RECTANGLE.
emissionShape[get, set] CPUParticles2D.EmissionShapeParticles will be emitted inside this region. See emissionshape for possible values.
emissionSphereRadius[get, set] doubleThe sphere's radius if emissionShape is set to constant EMISSION_SHAPE_SPHERE.
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.
flagAlignY[get, set] boolAlign Y axis of particle with the direction of its velocity.
fractDelta[get, set] boolIf true, results in fractional delta calculation which has a smoother particles display effect.
gravity[get, set] Vector2Gravity applied to every particle.
hueVariation[get, set] doubleInitial hue variation applied to each particle.
hueVariationCurve[get, set] CurveEach particle's hue will vary along this Curve.
hueVariationRandom[get, set] doubleHue variation randomness ratio.
initialVelocity[get, set] doubleInitial velocity magnitude for each particle. Direction comes from spread and the node's orientation.
initialVelocityRandom[get, set] doubleInitial velocity randomness ratio.
lifetime[get, set] doubleAmount of time each particle will exist.
lifetimeRandomness[get, set] doubleParticle lifetime randomness ratio.
linearAccel[get, set] doubleLinear acceleration applied to each particle in the direction of motion.
linearAccelCurve[get, set] CurveEach particle's linear acceleration will vary along this Curve.
linearAccelRandom[get, set] doubleLinear acceleration randomness ratio.
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.
orbitVelocity[get, set] doubleOrbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
orbitVelocityCurve[get, set] CurveEach particle's orbital velocity will vary along this Curve.
orbitVelocityRandom[get, set] doubleOrbital velocity randomness ratio.
preprocess[get, set] doubleParticle system starts as if it had already run for this many seconds.
radialAccel[get, set] doubleRadial acceleration applied to each particle. Makes particle accelerate away from origin.
radialAccelCurve[get, set] CurveEach particle's radial acceleration will vary along this Curve.
radialAccelRandom[get, set] doubleRadial acceleration randomness ratio.
randomness[get, set] doubleEmission lifetime randomness ratio.
scaleAmount[get, set] doubleInitial scale applied to each particle.
scaleAmountCurve[get, set] CurveEach particle's scale will vary along this Curve.
scaleAmountRandom[get, set] doubleScale randomness ratio.
speedScale[get, set] doubleParticle system's running speed scaling ratio. A value of 0 can be used to pause the particles.
spread[get, set] doubleEach particle's initial direction range from +spread to -spread degrees.
tangentialAccel[get, set] doubleTangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
tangentialAccelCurve[get, set] CurveEach particle's tangential acceleration will vary along this Curve.
tangentialAccelRandom[get, set] doubleTangential acceleration randomness ratio.
texture[get, set] TextureParticle texture. If null, particles will be squares.

Methods

NameDescription
_updateRenderThread
convertFromParticles Sets this node's properties to match a given Particles2D node with an assigned ParticlesMaterial.
getAmount
getColor
getColorRamp
getDirection
getDrawOrder
getEmissionColors
getEmissionNormals
getEmissionPoints
getEmissionRectExtents
getEmissionShape
getEmissionSphereRadius
getExplosivenessRatio
getFixedFps
getFractionalDelta
getGravity
getLifetime
getLifetimeRandomness
getNormalmap
getOneShot
getParam Returns the base value of the parameter specified by parameter.
getParamCurve Returns the Curve of the parameter specified by parameter.
getParamRandomness Returns the randomness factor of the parameter specified by parameter.
getParticleFlag Returns the enabled state of the given flag (see flags for options).
getPreProcessTime
getRandomnessRatio
getSpeedScale
getSpread
getTexture
getUseLocalCoordinates
isEmitting
restart Restarts the particle emitter.
setAmount
setColor
setColorRamp
setDirection
setDrawOrder
setEmissionColors
setEmissionNormals
setEmissionPoints
setEmissionRectExtents
setEmissionShape
setEmissionSphereRadius
setEmitting
setExplosivenessRatio
setFixedFps
setFractionalDelta
setGravity
setLifetime
setLifetimeRandomness
setNormalmap
setOneShot
setParam Sets the base value of the parameter specified by parameter.
setParamCurve Sets the Curve of the parameter specified by parameter.
setParamRandomness Sets the randomness factor of the parameter specified by parameter.
setParticleFlag Enables or disables the given flag (see flags for options).
setPreProcessTime
setRandomnessRatio
setSpeedScale
setSpread
setTexture
setUseLocalCoordinates

Enums

NameDescription
Constants
DrawOrder
EmissionShape
Flags
Parameter