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

Behavior element behavior adding particle emitter support. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorParticleEmitter:
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...
 
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...
 

Detailed Description

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:

class MyElement extends BehaviorElementClass
public func new()
ECBehaviorParticleEmitter.new(this)
ECBehaviorParticleEmitter.new(this, "subParticleEmitter")
end
end
ECBehaviorParticleEmitter new(BehaviorElementClass eclass, ECBehaviorCollider collider)
Create behavior element class.

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)}.".

Listening

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).

Member Function Documentation

◆ addListenerFactory() [1/2]

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

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

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

Add listener factory.

◆ createListeners()

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

Create listeners from factories adding them to behavior instance.

◆ dispose()

void Dragengine.Scenery.ECBehaviorParticleEmitter.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachListenerFactory()

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

Visit listener factories with block with argument ListenerFactory.

◆ getAttach()

ECComposeAttachResource Dragengine.Scenery.ECBehaviorParticleEmitter.getAttach ( )

Attach resource.

◆ getBehaviorIn()

static ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.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.ECBehaviorParticleEmitter.getCollider ( )

Collider behavior or null to not attach.

◆ getParticleEmitter()

ECComposeParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.getParticleEmitter ( )

Composeable particle emitter for element class.

◆ getSyncTrigger()

ECBehaviorParticleEmitter Dragengine.Scenery.ECBehaviorParticleEmitter.getSyncTrigger ( )

ECBehaviorParticleEmitter to synchronize triggers with or null to disable.

◆ getTargetCasting()

ECPString Dragengine.Scenery.ECBehaviorParticleEmitter.getTargetCasting ( )

Target casting.

◆ getTargetLastParticleDied()

ECPString Dragengine.Scenery.ECBehaviorParticleEmitter.getTargetLastParticleDied ( )

Target last particle died.

◆ getTrigger()

ECBehaviorTriggered Dragengine.Scenery.ECBehaviorParticleEmitter.getTrigger ( )

Trigger casting.

◆ getTriggerTable()

TSTriggerTable Dragengine.Scenery.ECBehaviorParticleEmitter.getTriggerTable ( )

Trigger table or null if not used.

◆ new() [1/6]

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

Create behavior element class.

These values are optional and can be null: collider.

◆ new() [2/6]

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

◆ new() [3/6]

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

◆ new() [4/6]

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

◆ new() [5/6]

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

◆ new() [6/6]

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

◆ setSyncTrigger()

void Dragengine.Scenery.ECBehaviorParticleEmitter.setSyncTrigger ( ECBehaviorParticleEmitter  behavior)

Set ECBehaviorParticleEmitter to synchronize triggers with or null to disable.

◆ setTriggerTable()

void Dragengine.Scenery.ECBehaviorParticleEmitter.setTriggerTable ( TSTriggerTable  triggerTable)
protected

Set trigger table or null if not used.


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