Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding two state animation support. More...
Classes | |
class | BlockListenerFactory |
Factory creating listeners using block. More... | |
class | BooleanListener |
Implementation of behavior instance listener using BooleanBehaviorListener. 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... | |
Additional Inherited Members | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
void | dispose () |
Dispose of behavior. 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... | |
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 two state animation support.
Plays back animations for behavior elements in two different states with transition between them. Animators are required to have controllers name the right way to work with this behavior. Controllers not matching the require name are ignored. It is not necessary to have all controller names covered. Actually this behavior optimizes at runtime if not all controllers are used.
The controller names can be changed using the setControllerName*() methods.
When changing to true the element is switched to the activated state. When changing to false the element is switched to the deactivated state. If the switch happens during transition time the transition is finished before switching.
By default the ECBehaviorComponent with empty identifier is animated. Multiple ECBehaviorTwoStateAnimated can be added targeting different ECBehaviorComponent using their identifier. It is also possible to add multiple ECBehaviorTwoStateAnimated manipulating the same ECBehaviorComponent as long as the animators used are properly crafted. This can be used for example to add overlayed animations.
To use this behavior make sure to add first the ECBehaviorComponent to animate. The example below adds to components and animates each using an own animator.
Because multiple animator behaviors can animate the same component behavior the animator behavior has an own identifier. In the example above the first string parameter is the animator behavior identifier while the second string parameter is the component behavior identifier to animate.
Element class properties have the prefix "twoStateAnimated{(id)}.".
This behavior does require the element class to be persistable (setPersistable).