SFX-Classes

class SFXEmitter

class SFXEmitter : SceneObject
SFXEmitter()

Creates a new SFXEmitter-Object

Example:

local emitter = SFXEmitter() -- Creates a new SFXEmitter-Object
local emitter = scenetree.findObject(5213) -- Gets the SFXEmitter via its ID
-- You can get the ID by the Editor using Scene Tree

class SFXSource

class SFXSource : SimGroup
play(float fadeIn = -1.0)

Starts the sound from the current playback position.

  • float fadeInTime: Seconds for sound to fade in. If -1, fadeInTime from SFXDescription is used. Note that certain SFXSource classes may not support values other than 0 and -1.
stop(float fadeOutTime = -1.0)

Pauses the sound playback.

Parameters:fadeOutTime – Seconds for sound to fade out. If -1, fadeOutTime from SFXDescription is used. Note that certain SFXSource clsases may not support values other than 0 and -1.
bool isPlaying()

Returns true if the source is playing.

setVolume(float volume)

Sets the source volume which will still be scaled by the master and group volumes.

Note

Note that if you set an explicit volume on a source

float getVolume()

Returns the source volume at its unaltered initial setting, i.e. prior to fading, modulation, and attenuation.

setPitch(float pitch)

Sets the source pitch scale.

float getTotalPlayTime()

Return the total play time of the source in seconds. Positive infinity by default.

Note

For looping sounds, this must include only the playtime of a single cycle.

class SFXSourceChannel : SFXSource
class SFXSound : SFXSource
class SFXDescription : SimDataBlock
class SFXSceneBlendLayer2D : SFXSource
SFXSceneBlendLayer2D()
init(char jsonFile, float volX, float vol)
blend(float x, float y)
setTransform(MatrixF transform)
setVelocity(VectorF velocity)
setEventString(char trackName)
setParameter(char name, F32 value)
setVolume(float vol)