Drag[en]gine Script Module DragonScript
1.23
|
Behavior adding animation support to actors. 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... | |
ECPAnimatorMap | getAnimators () |
Animators. More... | |
ECBehaviorComponent | getComponent () |
Component behavior to animate. More... | |
Dictionary | getControllerMapping () |
Controller mapping as Dictionary mapping String name to Locomotion.ATTR_* . More... | |
ECBehaviorLocomotion | getLocomotion () |
Locomotion behavior or null. More... | |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion) |
Create behavior element class. More... | |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders) |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders, String id) |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders, String id, String subID) |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders, String id, String subID, String prefix) |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, String id) |
ECBehaviorActorAnimated | new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, String id, String subID) |
void | setDefaultControllerMappings () |
Set default controller mappings. 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 ECBehaviorActorAnimated | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Public Attributes | |
ECPAnimatorMap | pAnimators |
ECBehaviorComponent | pComponent |
Dictionary | pControllerMappings |
Array | pListenerFactories |
ECBehaviorLocomotion | pLocomotion |
Additional Inherited Members | |
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 adding animation support to actors.
Adds AnimatorInstance and a map of animators to switch using string identifiers.
To simplify using actor animation a map of controller bindings can be defined to be applied to ECBehaviorLocomotion each time the animator changes. This requires controller names to be consistent and unique across animators but makes life a lot easier. If no map is defined the behavior does not change the locomotion controller mapping. While changing animator controllers with matching names are not reset.
To use this class add these behaviors to the actor:
Multiple behaviors can be added to animated different parts of the actor independent.
Element class property prefix is "actorAnimated{(id)}".
void Dragengine.Scenery.ECBehaviorActorAnimated.addListenerFactory | ( | Block | blockFactory | ) |
void Dragengine.Scenery.ECBehaviorActorAnimated.addListenerFactory | ( | ListenerFactory | factory | ) |
Add listener factory.
void Dragengine.Scenery.ECBehaviorActorAnimated.createListeners | ( | Instance | instance | ) |
Create listeners from factories adding them to behavior instance.
void Dragengine.Scenery.ECBehaviorActorAnimated.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
void Dragengine.Scenery.ECBehaviorActorAnimated.forEachListenerFactory | ( | Block | ablock | ) |
Visit listener factories with block with argument ListenerFactory.
ECPAnimatorMap Dragengine.Scenery.ECBehaviorActorAnimated.getAnimators | ( | ) |
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorComponent.
ECBehaviorComponent Dragengine.Scenery.ECBehaviorActorAnimated.getComponent | ( | ) |
Component behavior to animate.
Dictionary Dragengine.Scenery.ECBehaviorActorAnimated.getControllerMapping | ( | ) |
Controller mapping as Dictionary mapping String name to Locomotion.ATTR_* .
ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorActorAnimated.getLocomotion | ( | ) |
Locomotion behavior or null.
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion | ||
) |
Create behavior element class.
These values are optional and can be null: locomotion.
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion, | ||
Loaders | loaders | ||
) |
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion, | ||
Loaders | loaders, | ||
String | id | ||
) |
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion, | ||
Loaders | loaders, | ||
String | id, | ||
String | subID | ||
) |
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion, | ||
Loaders | loaders, | ||
String | id, | ||
String | subID, | ||
String | prefix | ||
) |
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion, | ||
String | id | ||
) |
ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new | ( | BehaviorElementClass | eclass, |
ECBehaviorComponent | component, | ||
ECBehaviorLocomotion | locomotion, | ||
String | id, | ||
String | subID | ||
) |
void Dragengine.Scenery.ECBehaviorActorAnimated.setDefaultControllerMappings | ( | ) |
Set default controller mappings.
Sets dictionary to these values: "idle": Locomotion.ATTR_ELAPSED_TIME "look.vertical": Locomotion.ATTR_LOOK_VERTICAL "look.horizontal": Locomotion.ATTR_LOOK_HORIZONTAL "turn.inPlace": Locomotion.ATTR_TIME_TURNIP "stance": Locomotion.ATTR_STANCE "move.walk": Locomotion.ATTR_DISPLACEMENT "move.run": Locomotion.ATTR_DISPLACEMENT "move.velocity": Locomotion.ATTR_RELATIVE_MOVING_SPEED "tilt.vertical": Locomotion.ATTR_TILT_VERTICAL "tilt.horizontal": Locomotion.ATTR_TILT_HORIZONTAL "tilt.offset": Locomotion.ATTR_TILT_OFFSET "interaction": Locomotion.ATTR_ELAPSED_TIME
ECPAnimatorMap Dragengine.Scenery.ECBehaviorActorAnimated.pAnimators |
ECBehaviorComponent Dragengine.Scenery.ECBehaviorActorAnimated.pComponent |
Dictionary Dragengine.Scenery.ECBehaviorActorAnimated.pControllerMappings |
Array Dragengine.Scenery.ECBehaviorActorAnimated.pListenerFactories |
ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorActorAnimated.pLocomotion |