Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.GWBehaviorOneShotSpeaker Class Reference

GameWorld Behavior adding support for one-shot speakers. More...

Inheritance diagram for Dragengine.Scenery.GWBehaviorOneShotSpeaker:
Dragengine.Scenery.DefaultGWBehavior Dragengine.Scenery.GWBehavior

Public Member Functions

void addSpeaker (Speaker speaker)
 Add one shot speaker. More...
 
void dispose ()
 Dispose of behavior. More...
 
LayerMask getLayerMask ()
 Layer mask to use for one shot speaker. More...
 
Speaker getSpeakerAt (int index)
 Speaker at index. More...
 
int getSpeakerCount ()
 Count of speakers. More...
 
GWBehaviorOneShotSpeaker new (GameWorld gameWorld)
 Create element. More...
 
void playSoundOnce (Sound sound, DVector position, float volume, float range)
 Play sound once. More...
 
void playSoundOnce (Sound sound, DVector position, Quaternion orientation, float volume, float range)
 Play sound once. More...
 
void playSoundOnce (Sound sound, Element element, float volume, float range)
 Play sound once. More...
 
void playSynthesizerOnce (SynthesizerInstance synthesizer, DVector position, float volume, float range)
 Play synthesizer instance once. More...
 
void playSynthesizerOnce (SynthesizerInstance synthesizer, DVector position, Quaternion orientation, float volume, float range)
 Play synthesizer instance once. More...
 
void playSynthesizerOnce (SynthesizerInstance synthesizer, Element element, float volume, float range)
 Play synthesizer instance once. More...
 
void removeFinishedSpeakers ()
 Remove one shot speakers that finished playing. More...
 
void setLayerMask (LayerMask layerMask)
 Set layer mask to use for one shot speaker. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultGWBehavior
String getBehaviorID ()
 Unique identifier of behavior. More...
 
GameWorld getGameWorld ()
 Game world this behavior belongs to. More...
 
String getID ()
 Identifier. More...
 
void init (StubGameWorld stub)
 Initialize game world from stub. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader)
 Load data of another behavior. More...
 
DefaultGWBehavior new (GameWorld gameWorld, String id)
 Create default behavior. More...
 
void postThink (float elapsed)
 Post thinking after physics processing is finished. More...
 
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read from file. More...
 
bool requiresPersistency ()
 Behavior requires readFromFile() and writeToFile() to be called. More...
 
bool requiresThink ()
 Behavior instance requires update(), think() and postThink() to be called. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading data of another behavior. More...
 
void think (float elapsed)
 Think about what to do for the next frame update. More...
 
void update (float elapsed)
 Frame update. More...
 
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write to file. More...
 

Static Public Member Functions

static GWBehaviorOneShotSpeaker getBehaviorIn (GameWorld gameWorld)
 Get behavior in game world or null if absent. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultGWBehavior
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void setRequiresPersistency (bool required)
 Set if behavior requires readFromFile() and writeToFile() to be called. More...
 
void setRequiresThink (bool required)
 Set if behavior instance requires update(), think() and postThink() to be called. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

GameWorld Behavior adding support for one-shot speakers.

One shot speakers are deploy-and-forget type speakers playing a sound or synthesizer once then self-destroy.

This behavior can be present only once in a GameWorld.

Member Function Documentation

◆ addSpeaker()

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.addSpeaker ( Speaker  speaker)

Add one shot speaker.

Plays a short sound once and will be deleted once finished playing.

◆ dispose()

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultGWBehavior.

◆ getBehaviorIn()

static GWBehaviorOneShotSpeaker Dragengine.Scenery.GWBehaviorOneShotSpeaker.getBehaviorIn ( GameWorld  gameWorld)
static

Get behavior in game world or null if absent.

Use this method to check if GameWorld contains behavior of type GWBehaviorOneShotSpeaker.

◆ getLayerMask()

LayerMask Dragengine.Scenery.GWBehaviorOneShotSpeaker.getLayerMask ( )

Layer mask to use for one shot speaker.

◆ getSpeakerAt()

Speaker Dragengine.Scenery.GWBehaviorOneShotSpeaker.getSpeakerAt ( int  index)

Speaker at index.

◆ getSpeakerCount()

int Dragengine.Scenery.GWBehaviorOneShotSpeaker.getSpeakerCount ( )

Count of speakers.

◆ new()

GWBehaviorOneShotSpeaker Dragengine.Scenery.GWBehaviorOneShotSpeaker.new ( GameWorld  gameWorld)

Create element.

Reimplemented from Dragengine.Scenery.DefaultGWBehavior.

◆ playSoundOnce() [1/3]

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSoundOnce ( Sound  sound,
DVector  position,
float  volume,
float  range 
)

Play sound once.

Create speaker with sound and parameters playing it once. Does nothing if sound is null.

◆ playSoundOnce() [2/3]

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSoundOnce ( Sound  sound,
DVector  position,
Quaternion  orientation,
float  volume,
float  range 
)

Play sound once.

Create speaker with sound and parameters playing it once. Does nothing if sound is null.

◆ playSoundOnce() [3/3]

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSoundOnce ( Sound  sound,
Element  element,
float  volume,
float  range 
)

Play sound once.

Create speaker with sound and parameters playing it once. Does nothing if sound is null.

◆ playSynthesizerOnce() [1/3]

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSynthesizerOnce ( SynthesizerInstance  synthesizer,
DVector  position,
float  volume,
float  range 
)

Play synthesizer instance once.

Create speaker with synthesizer instance and parameters playing it once. Does nothing if synthesizer is null.

◆ playSynthesizerOnce() [2/3]

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSynthesizerOnce ( SynthesizerInstance  synthesizer,
DVector  position,
Quaternion  orientation,
float  volume,
float  range 
)

Play synthesizer instance once.

Create speaker with synthesizer instance and parameters playing it once. Does nothing if synthesizer is null.

◆ playSynthesizerOnce() [3/3]

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.playSynthesizerOnce ( SynthesizerInstance  synthesizer,
Element  element,
float  volume,
float  range 
)

Play synthesizer instance once.

Create speaker with synthesizer instance and parameters playing it once. Does nothing if synthesizer is null.

◆ removeFinishedSpeakers()

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.removeFinishedSpeakers ( )

Remove one shot speakers that finished playing.

◆ setLayerMask()

void Dragengine.Scenery.GWBehaviorOneShotSpeaker.setLayerMask ( LayerMask  layerMask)

Set layer mask to use for one shot speaker.


The documentation for this class was generated from the following file: