Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding particle emitter 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... | |
ECComposeAttachResource | getAttach () |
Attach resource. More... | |
ECBehaviorCollider | getCollider () |
Collider behavior or null to not attach. More... | |
ECComposeParticleEmitter | getParticleEmitter () |
Composeable particle emitter for element class. More... | |
ECBehaviorParticleEmitter | getSyncTrigger () |
ECBehaviorParticleEmitter to synchronize triggers with or null to disable. More... | |
ECPString | getTargetCasting () |
Target casting. More... | |
ECPString | getTargetLastParticleDied () |
Target last particle died. More... | |
ECBehaviorTriggered | getTrigger () |
Trigger casting. More... | |
TSTriggerTable | getTriggerTable () |
Trigger table or null if not used. More... | |
ECBehaviorParticleEmitter | new (BehaviorElementClass eclass, ECBehaviorCollider collider) |
Create behavior element class. More... | |
ECBehaviorParticleEmitter | new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable) |
ECBehaviorParticleEmitter | new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable, String id) |
ECBehaviorParticleEmitter | new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable, String id, String subID) |
ECBehaviorParticleEmitter | new (BehaviorElementClass eclass, ECBehaviorCollider collider, Loaders loaders, TSTriggerTable triggerTable, String id, String subID, String prefix) |
ECBehaviorParticleEmitter | new (BehaviorElementClass eclass, ECBehaviorCollider collider, String id) |
void | setSyncTrigger (ECBehaviorParticleEmitter behavior) |
Set ECBehaviorParticleEmitter to synchronize triggers with or null to disable. 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 ECBehaviorParticleEmitter | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Protected Member Functions | |
void | setTriggerTable (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 particle emitter support.
Behavior adds a ParticleEmitter resource to the the behavior element. This behavior can be added multiple times to an element. Each instance creates one particle emitter attached to the element collider which can be individually modified. To distinguish the particle emitters each instance has an identifier which can be used to retrieve a specific instance. The prefix of the particle emitter class properties is "particleEmitter." . If the identifier is not empty the particle emitter element class properties have the prefix "{id}.particleEmitter.". This can be overwritten if required. Hence to use more than one particle emitter use code like this in your subclass constructor:
You can now define the parameters to use for both particle emitters using for example the properties "emitter" for the first particle emitter and "subParticleEmitter.emitter" for the second particle emitter.
It is recommended to always specify an identifier even if only one particle emitter is used. This avoids potentially name conflicts especially if other behaviors are added attaching other resources too.
If the ECBehaviorCollider behavior is present in the behavior element before this behavior is added the particle emitter is attached. The particle emitter is attached to the named bone if defined otherwise it is attached statically.
Element class properties have the prefix "particleEmitter{(id)}.".
Behavior elements and other behaviors can add listeners to the ECBehaviorParticleEmitter. Listeners are notified if the casting starts, casting stops and when the last particle of a burst emission died. This can be used to synchronize actions to these events. ECBehaviorParticleEmitter can also use trigger targets so listeners are not always required.
This behavior does require the element class to be persistable (setPersistable).
void Dragengine.Scenery.ECBehaviorParticleEmitter.addListenerFactory | ( | Block | blockFactory | ) |
void Dragengine.Scenery.ECBehaviorParticleEmitter.addListenerFactory | ( | ListenerFactory | factory | ) |
Add listener factory.
void Dragengine.Scenery.ECBehaviorParticleEmitter.createListeners | ( | Instance | instance | ) |
Create listeners from factories adding them to behavior instance.
void Dragengine.Scenery.ECBehaviorParticleEmitter.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
void Dragengine.Scenery.ECBehaviorParticleEmitter.forEachListenerFactory | ( | Block | ablock | ) |
Visit listener factories with block with argument ListenerFactory.
ECComposeAttachResource Dragengine.Scenery.ECBehaviorParticleEmitter.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.ECBehaviorParticleEmitter.getCollider | ( | ) |
Collider behavior or null to not attach.
ECComposeParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.getParticleEmitter | ( | ) |
Composeable particle emitter for element class.
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.getSyncTrigger | ( | ) |
ECBehaviorParticleEmitter to synchronize triggers with or null to disable.
ECPString Dragengine.Scenery.ECBehaviorParticleEmitter.getTargetCasting | ( | ) |
Target casting.
ECPString Dragengine.Scenery.ECBehaviorParticleEmitter.getTargetLastParticleDied | ( | ) |
Target last particle died.
ECBehaviorTriggered Dragengine.Scenery.ECBehaviorParticleEmitter.getTrigger | ( | ) |
Trigger casting.
TSTriggerTable Dragengine.Scenery.ECBehaviorParticleEmitter.getTriggerTable | ( | ) |
Trigger table or null if not used.
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider | ||
) |
Create behavior element class.
These values are optional and can be null: collider.
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable | ||
) |
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable, | ||
String | id | ||
) |
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable, | ||
String | id, | ||
String | subID | ||
) |
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
Loaders | loaders, | ||
TSTriggerTable | triggerTable, | ||
String | id, | ||
String | subID, | ||
String | prefix | ||
) |
ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
String | id | ||
) |
void Dragengine.Scenery.ECBehaviorParticleEmitter.setSyncTrigger | ( | ECBehaviorParticleEmitter | behavior | ) |
Set ECBehaviorParticleEmitter to synchronize triggers with or null to disable.
|
protected |
Set trigger table or null if not used.