Particles2D

GPU-based 2D particle emitter.

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. Note: Particles2D only work when using the GLES3 renderer. If using the GLES2 renderer, use CPUParticles2D instead. You can convert Particles2D to CPUParticles2D by selecting the node, clicking the Particles menu at the top of the 2D editor viewport then choosing Convert to CPUParticles2D. Note: After working on a Particles node, remember to update its visibilityRect by selecting it, clicking the Particles menu at the top of the 2D editor viewport then choose Generate Visibility Rect. Otherwise, particles may suddenly disappear depending on the camera position and angle. Note: Unlike CPUParticles2D, Particles2D currently ignore the texture region defined in AtlasTextures.

@GodotBaseClass
struct Particles2D {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
DrawOrder
enum DrawOrder

Functions

captureRect
Rect2 captureRect()

Returns a rectangle containing the positions of all existing particles.

getAmount
long getAmount()
getDrawOrder
Particles2D.DrawOrder getDrawOrder()
getExplosivenessRatio
double getExplosivenessRatio()
getFixedFps
long getFixedFps()
getFractionalDelta
bool getFractionalDelta()
getLifetime
double getLifetime()
getNormalMap
Ref!Texture getNormalMap()
getOneShot
bool getOneShot()
getPreProcessTime
double getPreProcessTime()
getProcessMaterial
Ref!Material getProcessMaterial()
getRandomnessRatio
double getRandomnessRatio()
getSpeedScale
double getSpeedScale()
getTexture
Ref!Texture getTexture()
getUseLocalCoordinates
bool getUseLocalCoordinates()
getVisibilityRect
Rect2 getVisibilityRect()
isEmitting
bool isEmitting()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(Particles2D other)
opEquals
bool opEquals(typeof(null) n)
restart
void restart()

Restarts all the existing particles.

setAmount
void setAmount(long amount)
setDrawOrder
void setDrawOrder(long order)
setEmitting
void setEmitting(bool emitting)
setExplosivenessRatio
void setExplosivenessRatio(double ratio)
setFixedFps
void setFixedFps(long fps)
setFractionalDelta
void setFractionalDelta(bool enable)
setLifetime
void setLifetime(double secs)
setNormalMap
void setNormalMap(Texture texture)
setOneShot
void setOneShot(bool secs)
setPreProcessTime
void setPreProcessTime(double secs)
setProcessMaterial
void setProcessMaterial(Material material)
setRandomnessRatio
void setRandomnessRatio(double ratio)
setSpeedScale
void setSpeedScale(double scale)
setTexture
void setTexture(Texture texture)
setUseLocalCoordinates
void setUseLocalCoordinates(bool enable)
setVisibilityRect
void setVisibilityRect(Rect2 visibility_rect)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

amount
long amount [@property getter]
long amount [@property setter]

The number of particles emitted in one emission cycle (corresponding to the lifetime). Note: Changing amount will reset the particle emission, therefore removing all particles that were already emitted before changing amount.

drawOrder
Particles2D.DrawOrder drawOrder [@property getter]
long drawOrder [@property setter]

Particle draw order. Uses draworder values.

emitting
bool emitting [@property getter]
bool emitting [@property setter]

If true, particles are being emitted.

explosiveness
double explosiveness [@property getter]
double explosiveness [@property setter]

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
long fixedFps [@property getter]
long fixedFps [@property setter]

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
bool fractDelta [@property getter]
bool fractDelta [@property setter]

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

lifetime
double lifetime [@property getter]
double lifetime [@property setter]

The amount of time each particle will exist (in seconds).

localCoords
bool localCoords [@property getter]
bool localCoords [@property setter]

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

normalMap
Texture normalMap [@property getter]
Texture normalMap [@property setter]

Normal map to be used for the texture property. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinatesthis page/url for a comparison of normal map coordinates expected by popular engines.

oneShot
bool oneShot [@property getter]
bool oneShot [@property setter]

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

preprocess
double preprocess [@property getter]
double preprocess [@property setter]

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

randomness
double randomness [@property getter]
double randomness [@property setter]

Emission lifetime randomness ratio.

speedScale
double speedScale [@property getter]
double speedScale [@property setter]

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

texture
Texture texture [@property getter]
Texture texture [@property setter]

Particle texture. If null, particles will be squares.

visibilityRect
Rect2 visibilityRect [@property getter]
Rect2 visibilityRect [@property setter]

The Rect2 that determines the node's region which needs to be visible on screen for the particle system to be active. Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The Rect2 can be grown via code or with the Particles → Generate Visibility Rect editor tool.

Static functions

_new
Particles2D _new()

Construct a new instance of Particles2D. Note: use memnew!Particles2D instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta