• Functions for controlling particle effect component playback and shader constants.

Static methods

@:has_untypedstaticinlineplay(url:UrlOrString, ?emitterStateCb:(id:Hash, emitter:Hash, state:ParticlefxEmitterState) ‑> Void):Void

  • Start playing a particle FX.

Particle FX started this way need to be manually stopped through Particlefx.stop. Which particle FX to play is identified by the URL.

Parameters:

url

the particle fx that should start playing

emitterStateCb

optional callback that will be called when an emitter attached to this particlefx changes state. The callback receives the hash of the path to the particlefx, the hash of the id of the emitter, and the new state of the emitter.

@:native("reset_constant")staticresetConstant(url:UrlOrString, emitterId:HashOrString, name:HashOrString):Void

  • Reset a shader constant for a particle FX emitter.

The constant must be defined in the material assigned to the emitter. Resetting a constant through this function implies that the value defined in the material will be used. Which particle FX to reset a constant for is identified by the URL.

Parameters:

url

the particle FX that should have a constant reset

emitterId

the id of the emitter

name

the name of the constant

@:native("set_constant")staticsetConstant(url:UrlOrString, emitterId:HashOrString, name:HashOrString, value:Vector4):Void

  • Set a shader constant for a particle FX emitter.

The constant must be defined in the material assigned to the emitter. Setting a constant through this function will override the value set for that constant in the material. The value will be overridden until particlefx.reset_constant is called. Which particle FX to set a constant for is identified by the URL.

Parameters:

url

the particle FX that should have a constant set

emitterId

the id of the emitter

name

the name of the constant

value

the value of the constant

staticstop(url:UrlOrString, options:ParticleFxStopOptions):Void

  • Stop playing a particle fx.

Stopping a particle FX does not remove the already spawned particles. Which particle fx to stop is identified by the URL.

Parameters:

url

the particle fx that should stop playing

options

options when stopping the particle fx