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

Behavior element behavior adding two state animation support. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorTwoStateAnimated:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

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

Detailed Description

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.

  • "deactivated": Controller used while the behavior is in deactivated state. This is typically an unclamped controller. If missing behavior does not think consuming no processing time.
  • "activated": Controller used while the behavior is in activated state. This is typically an unclamped controller. If missing behavior does not think consuming no processing time.
  • "activating": Controller used while behavior is transitioning from deactivated state to activated state. The transition ends when the controller reaches the upper limit. For this reason the controller has to be a clamped controller otherwise the transition never ends. If missing behavior transitions immediately to activated state.
  • "deactivating": Controller used while behavior is transitioning from activated state to deactivated state. The transition ends when the controller reaches the upper limit. For this reason the controller has to be a clamped controller otherwise the transition never ends. If missing behavior transitions immediately to deactivated state.

The controller names can be changed using the setControllerName*() methods.

Activate Trigger

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.

Configuration

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.

class MyElement extends BehaviorElementClass
var ECBehaviorComponent component
var ECBehaviorComponent subComponent
func new()
component = ECBehaviorComponent.new(this)
ECBehaviorTwoStateAnimated.new(this, component)
subComponent = ECBehaviorComponent.new(this, "subComponent")
ECBehaviorTwoStateAnimated.new(this, subComponent, "subAnimator")
end
end
DefaultECBehavior new(BehaviorElementClass eclass)
Create default composeable behavior with empty identifier.

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


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