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
Name | Type | Description |
---|---|---|
amount [get, set]
|
long | Number of particles emitted in one emission cycle. |
angle [get, set]
|
double | Initial rotation applied to each particle, in degrees. |
angleCurve [get, set]
|
Curve | Each particle's rotation will be animated along this Curve .
|
angleRandom [get, set]
|
double | Rotation randomness ratio. |
angularVelocity [get, set]
|
double | Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. |
angularVelocityCurve [get, set]
|
Curve | Each particle's angular velocity will vary along this Curve .
|
angularVelocityRandom [get, set]
|
double | Angular velocity randomness ratio. |
animOffset [get, set]
|
double | Particle animation offset. |
animOffsetCurve [get, set]
|
Curve | Each particle's animation offset will vary along this Curve .
|
animOffsetRandom [get, set]
|
double | Animation offset randomness ratio. |
animSpeed [get, set]
|
double | Particle animation speed. |
animSpeedCurve [get, set]
|
Curve | Each particle's animation speed will vary along this Curve .
|
animSpeedRandom [get, set]
|
double | Animation speed randomness ratio. |
color [get, set]
|
Color | Each particle's initial color. If texture is defined, it will be multiplied by this color.
|
colorRamp [get, set]
|
Gradient | Each particle's color will vary along this Gradient .
|
damping [get, set]
|
double | The rate at which particles lose velocity. |
dampingCurve [get, set]
|
Curve | Damping will vary along this Curve .
|
dampingRandom [get, set]
|
double | Damping randomness ratio. |
direction [get, set]
|
Vector2 | Unit vector specifying the particles' emission direction. |
drawOrder [get, set]
|
CPUParticles2D | Particle draw order. Uses draworder values.
|
emissionColors [get, set]
|
PoolArray!(godot.core.color.Color) | Sets the Color s 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]
|
Vector2 | The rectangle's extents if emissionShape is set to constant EMISSION_SHAPE_RECTANGLE .
|
emissionShape [get, set]
|
CPUParticles2D | Particles will be emitted inside this region. See emissionshape for possible values.
|
emissionSphereRadius [get, set]
|
double | The sphere's radius if emissionShape is set to constant EMISSION_SHAPE_SPHERE .
|
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. |
flagAlignY [get, set]
|
bool | Align Y axis of particle with the direction of its velocity. |
fractDelta [get, set]
|
bool | If true , results in fractional delta calculation which has a smoother particles display effect.
|
gravity [get, set]
|
Vector2 | Gravity applied to every particle. |
hueVariation [get, set]
|
double | Initial hue variation applied to each particle. |
hueVariationCurve [get, set]
|
Curve | Each particle's hue will vary along this Curve .
|
hueVariationRandom [get, set]
|
double | Hue variation randomness ratio. |
initialVelocity [get, set]
|
double | Initial velocity magnitude for each particle. Direction comes from spread and the node's orientation.
|
initialVelocityRandom [get, set]
|
double | Initial velocity randomness ratio. |
lifetime [get, set]
|
double | Amount of time each particle will exist. |
lifetimeRandomness [get, set]
|
double | Particle lifetime randomness ratio. |
linearAccel [get, set]
|
double | Linear acceleration applied to each particle in the direction of motion. |
linearAccelCurve [get, set]
|
Curve | Each particle's linear acceleration will vary along this Curve .
|
linearAccelRandom [get, set]
|
double | Linear acceleration randomness ratio. |
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.
|
orbitVelocity [get, set]
|
double | Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. |
orbitVelocityCurve [get, set]
|
Curve | Each particle's orbital velocity will vary along this Curve .
|
orbitVelocityRandom [get, set]
|
double | Orbital velocity randomness ratio. |
preprocess [get, set]
|
double | Particle system starts as if it had already run for this many seconds. |
radialAccel [get, set]
|
double | Radial acceleration applied to each particle. Makes particle accelerate away from origin. |
radialAccelCurve [get, set]
|
Curve | Each particle's radial acceleration will vary along this Curve .
|
radialAccelRandom [get, set]
|
double | Radial acceleration randomness ratio. |
randomness [get, set]
|
double | Emission lifetime randomness ratio. |
scaleAmount [get, set]
|
double | Initial scale applied to each particle. |
scaleAmountCurve [get, set]
|
Curve | Each particle's scale will vary along this Curve .
|
scaleAmountRandom [get, set]
|
double | Scale randomness ratio. |
speedScale [get, set]
|
double | Particle system's running speed scaling ratio. A value of 0 can be used to pause the particles.
|
spread [get, set]
|
double | Each particle's initial direction range from +spread to -spread degrees.
|
tangentialAccel [get, set]
|
double | Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. |
tangentialAccelCurve [get, set]
|
Curve | Each particle's tangential acceleration will vary along this Curve .
|
tangentialAccelRandom [get, set]
|
double | Tangential acceleration randomness ratio. |
texture [get, set]
|
Texture | Particle texture. If null , particles will be squares.
|
Methods
Enums
Name | Description |
---|---|
Constants
|
|
DrawOrder
|
|
EmissionShape
|
|
Flags
|
|
Parameter
|