Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorAnnouncer Class Reference

Behavior element behavior adding announcer support. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorAnnouncer:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  BlockListenerFactory
 Factory creating listeners using block. More...
 
class  DefaultListener
 Default implementation of behavior instance listener. More...
 
class  Instance
 Behavior instance. More...
 
interface  Listener
 Listener for behavior instance events. More...
 
interface  ListenerFactory
 Factory creating listeners. More...
 

Public Member Functions

void addListenerFactory (Block blockFactory)
 Add listener factory using block. More...
 
void addListenerFactory (ListenerFactory factory)
 Add listener factory. More...
 
void createListeners (Instance instance)
 Create listeners from factories adding them to behavior instance. More...
 
void dispose ()
 Dispose of behavior. More...
 
void forEachListenerFactory (Block ablock)
 Visit listener factories with block with argument ListenerFactory. More...
 
ECPAnnouncer getAnnouncer ()
 Announcer. More...
 
ECComposeAttachResource getAttach ()
 Attach resource. More...
 
ECBehaviorCollider getCollider ()
 Collider behavior or null to not attach. More...
 
ECPFloat getDistanceOffset ()
 Distance offset for attenuation calculation. More...
 
LayerMask getLayerMask ()
 Layer mask. More...
 
ECPFloat getRange ()
 Speaker range. More...
 
ECPFloat getRollOff ()
 Roll off. More...
 
ECPShapeList getShape ()
 Speaker shape. More...
 
ECPEnumeration getSpeakerType ()
 Speaker type. More...
 
ECPString getText ()
 Announcement text. More...
 
ECBehaviorTriggered getTrigger ()
 Trigger playing. More...
 
TSTriggerTable getTriggerTable ()
 Trigger table or null if not used. More...
 
ECPFloat getVolume ()
 Speaker volume. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
ECBehaviorAnnouncer new (BehaviorElementClass eclass, ECBehaviorCollider collider)
 Create behavior element class. More...
 
ECBehaviorAnnouncer new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable)
 Create behavior element class. More...
 
ECBehaviorAnnouncer new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable, String id)
 Create behavior element class. More...
 
ECBehaviorAnnouncer new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable, String id, String subID)
 
ECBehaviorAnnouncer new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable, String id, String subID, String prefix)
 
ECBehaviorAnnouncer new (BehaviorElementClass eclass, ECBehaviorCollider collider, String id)
 Create behavior element class. More...
 
void set (float range, float volume, Vector position)
 
void set (float range, float volume, Vector position, Vector orientation)
 
void set (float range, float volume, Vector position, Vector orientation, String bone)
 
void setLayerMask (LayerMask layerMask)
 Set layer mask. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorAnnouncer getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Protected Member Functions

void setTriggerTable (Loaders loaders, TSTriggerTable triggerTable)
 Set trigger table or null if not used. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. 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

Behavior element behavior adding announcer support.

Behavior uses an Announcer to play back announcer files. The speaker created by the Announcer instance is added to the game world. This behavior can be added multiple times to an element. Each instance creates one announcer speaker attached to the element collider which can be individually modified. To distinguish the announcers each instance has an identifier which can be used to retrieve a specific instance. Hence to use more than one announcer use code like this in your subclass constructor:

class MyElement extends BehaviorElementClass
ECBehaviorAnnouncer.new(this)
ECBehaviorAnnouncer.new(this, "subAnnouncer")
end
end
ECBehaviorAnnouncer new(BehaviorElementClass eclass, ECBehaviorCollider collider)
Create behavior element class.

You can now define the parameters to use for both announcers using for example the properties "announcer.volume" for the first speaker and "announcer(subAnnouncer).volume" for the second.

If the ECBehaviorCollider behavior is present the announcer speaker is attached. The speaker is attached to the named bone if defined otherwise it is attached statically.

This behavior contains a property to set the announcement text. Other behaviors can change this text at runtime to make this alter the announcement. Changing the announcement text will stop playing back the current announcement.

Element class properties have the prefix "announcer{(id)}.".

This behavior does not support persistency (setPersistable).

Member Function Documentation

◆ addListenerFactory() [1/2]

void Dragengine.Scenery.ECBehaviorAnnouncer.addListenerFactory ( Block  blockFactory)

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

void Dragengine.Scenery.ECBehaviorAnnouncer.addListenerFactory ( ListenerFactory  factory)

Add listener factory.

◆ createListeners()

void Dragengine.Scenery.ECBehaviorAnnouncer.createListeners ( Instance  instance)

Create listeners from factories adding them to behavior instance.

◆ dispose()

void Dragengine.Scenery.ECBehaviorAnnouncer.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachListenerFactory()

void Dragengine.Scenery.ECBehaviorAnnouncer.forEachListenerFactory ( Block  ablock)

Visit listener factories with block with argument ListenerFactory.

◆ getAnnouncer()

ECPAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.getAnnouncer ( )

Announcer.

◆ getAttach()

ECComposeAttachResource Dragengine.Scenery.ECBehaviorAnnouncer.getAttach ( )

Attach resource.

◆ getBehaviorIn()

static ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorCollider.

◆ getCollider()

ECBehaviorCollider Dragengine.Scenery.ECBehaviorAnnouncer.getCollider ( )

Collider behavior or null to not attach.

◆ getDistanceOffset()

ECPFloat Dragengine.Scenery.ECBehaviorAnnouncer.getDistanceOffset ( )

Distance offset for attenuation calculation.

Version
1.12

For use by distance sounds. Offsets the true distance to the sound source for attenuation calculation to make the sound appear coming from far away. Requires increasing the volume to compensate for the distance increased attenuation.

◆ getLayerMask()

LayerMask Dragengine.Scenery.ECBehaviorAnnouncer.getLayerMask ( )

Layer mask.

◆ getRange()

ECPFloat Dragengine.Scenery.ECBehaviorAnnouncer.getRange ( )

Speaker range.

◆ getRollOff()

ECPFloat Dragengine.Scenery.ECBehaviorAnnouncer.getRollOff ( )

Roll off.

◆ getShape()

ECPShapeList Dragengine.Scenery.ECBehaviorAnnouncer.getShape ( )

Speaker shape.

◆ getSpeakerType()

ECPEnumeration Dragengine.Scenery.ECBehaviorAnnouncer.getSpeakerType ( )

Speaker type.

◆ getText()

ECPString Dragengine.Scenery.ECBehaviorAnnouncer.getText ( )

Announcement text.

◆ getTrigger()

ECBehaviorTriggered Dragengine.Scenery.ECBehaviorAnnouncer.getTrigger ( )

Trigger playing.

◆ getTriggerTable()

TSTriggerTable Dragengine.Scenery.ECBehaviorAnnouncer.getTriggerTable ( )

Trigger table or null if not used.

◆ getVolume()

ECPFloat Dragengine.Scenery.ECBehaviorAnnouncer.getVolume ( )

Speaker volume.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorAnnouncer.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/6]

ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider 
)

Create behavior element class.

These value are optional and can be null: collider.

◆ new() [2/6]

ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider,
Loaders  loaders,
TSTriggerTable  triggerTable 
)

Create behavior element class.

◆ new() [3/6]

ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider,
Loaders  loaders,
TSTriggerTable  triggerTable,
String  id 
)

Create behavior element class.

◆ new() [4/6]

ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider,
Loaders  loaders,
TSTriggerTable  triggerTable,
String  id,
String  subID 
)

◆ new() [5/6]

ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider,
Loaders  loaders,
TSTriggerTable  triggerTable,
String  id,
String  subID,
String  prefix 
)

◆ new() [6/6]

ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider,
String  id 
)

Create behavior element class.

◆ set() [1/3]

void Dragengine.Scenery.ECBehaviorAnnouncer.set ( float  range,
float  volume,
Vector  position 
)

◆ set() [2/3]

void Dragengine.Scenery.ECBehaviorAnnouncer.set ( float  range,
float  volume,
Vector  position,
Vector  orientation 
)

◆ set() [3/3]

void Dragengine.Scenery.ECBehaviorAnnouncer.set ( float  range,
float  volume,
Vector  position,
Vector  orientation,
String  bone 
)

◆ setLayerMask()

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

Set layer mask.

◆ setTriggerTable()

void Dragengine.Scenery.ECBehaviorAnnouncer.setTriggerTable ( Loaders  loaders,
TSTriggerTable  triggerTable 
)
protected

Set trigger table or null if not used.


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