Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding announcer support. More...
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... | |
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:
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).
void Dragengine.Scenery.ECBehaviorAnnouncer.addListenerFactory | ( | Block | blockFactory | ) |
void Dragengine.Scenery.ECBehaviorAnnouncer.addListenerFactory | ( | ListenerFactory | factory | ) |
Add listener factory.
void Dragengine.Scenery.ECBehaviorAnnouncer.createListeners | ( | Instance | instance | ) |
Create listeners from factories adding them to behavior instance.
void Dragengine.Scenery.ECBehaviorAnnouncer.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
void Dragengine.Scenery.ECBehaviorAnnouncer.forEachListenerFactory | ( | Block | ablock | ) |
Visit listener factories with block with argument ListenerFactory.
ECPAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.getAnnouncer | ( | ) |
Announcer.
ECComposeAttachResource Dragengine.Scenery.ECBehaviorAnnouncer.getAttach | ( | ) |
Attach resource.
|
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.
ECBehaviorCollider Dragengine.Scenery.ECBehaviorAnnouncer.getCollider | ( | ) |
Collider behavior or null to not attach.
ECPFloat Dragengine.Scenery.ECBehaviorAnnouncer.getDistanceOffset | ( | ) |
Distance offset for attenuation calculation.
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.
LayerMask Dragengine.Scenery.ECBehaviorAnnouncer.getLayerMask | ( | ) |
Layer mask.
ECPFloat Dragengine.Scenery.ECBehaviorAnnouncer.getRollOff | ( | ) |
Roll off.
ECPShapeList Dragengine.Scenery.ECBehaviorAnnouncer.getShape | ( | ) |
Speaker shape.
ECPEnumeration Dragengine.Scenery.ECBehaviorAnnouncer.getSpeakerType | ( | ) |
Speaker type.
ECPString Dragengine.Scenery.ECBehaviorAnnouncer.getText | ( | ) |
Announcement text.
ECBehaviorTriggered Dragengine.Scenery.ECBehaviorAnnouncer.getTrigger | ( | ) |
Trigger playing.
TSTriggerTable Dragengine.Scenery.ECBehaviorAnnouncer.getTriggerTable | ( | ) |
Trigger table or null if not used.
Instance Dragengine.Scenery.ECBehaviorAnnouncer.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider | ||
) |
Create behavior element class.
These value are optional and can be null: collider.
ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable | ||
) |
Create behavior element class.
ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable, | ||
String | id | ||
) |
Create behavior element class.
ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable, | ||
String | id, | ||
String | subID | ||
) |
ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable, | ||
String | id, | ||
String | subID, | ||
String | prefix | ||
) |
ECBehaviorAnnouncer Dragengine.Scenery.ECBehaviorAnnouncer.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
String | id | ||
) |
Create behavior element class.
void Dragengine.Scenery.ECBehaviorAnnouncer.set | ( | float | range, |
float | volume, | ||
Vector | position | ||
) |
void Dragengine.Scenery.ECBehaviorAnnouncer.set | ( | float | range, |
float | volume, | ||
Vector | position, | ||
Vector | orientation | ||
) |
void Dragengine.Scenery.ECBehaviorAnnouncer.set | ( | float | range, |
float | volume, | ||
Vector | position, | ||
Vector | orientation, | ||
String | bone | ||
) |
void Dragengine.Scenery.ECBehaviorAnnouncer.setLayerMask | ( | LayerMask | layerMask | ) |
Set layer mask.
|
protected |
Set trigger table or null if not used.