User Tools

Site Tools


dragengine:modules:dragonscript:behavior_animated

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_animated [2025/03/12 14:43] – [ECBehaviorAnimated] dragonlorddragengine:modules:dragonscript:behavior_animated [2025/03/13 17:10] (current) dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorAnimated**+[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorAnimated**
 </WRAP> </WRAP>
  
Line 108: Line 108:
  
 A typical usage pattern for such behaviors is to locate the animator controller to update during construction time and to manipulated the controllers inside updateControllers(). A typical usage pattern for such behaviors is to locate the animator controller to update during construction time and to manipulated the controllers inside updateControllers().
 +
 See [[#element_class_example|Element Class Example]] for example code. See [[#element_class_example|Element Class Example]] for example code.
  
Line 130: Line 131:
 ====== Required Behaviors ====== ====== Required Behaviors ======
  
-This behavior requires these other behaviors: 
   * [[behavior_component|ECBehaviorComponent]]   * [[behavior_component|ECBehaviorComponent]]
  
Line 163: Line 163:
     component = ECBehaviorComponent.new(this, null)     component = ECBehaviorComponent.new(this, null)
     animated = ECBehaviorAnimated.new(this, component)     animated = ECBehaviorAnimated.new(this, component)
 +  end
 +end
 +</code>
 +
 +Example of using listeners.
 +
 +<code>
 +class MyListener extends ECBehaviorInstance.DefaultListener
 +  var AnimatorController pController
 +  
 +  func new(ECBehaviorAnimated behavior)
 +    pController = behavior.getAnimatorInstance().getControllerNamed("special controller")
 +  end
 +  
 +  func void updateControllers(Instance instance, float elapsed)
 +    pController.increment(elapsed)
   end   end
 end end
dragengine/modules/dragonscript/behavior_animated.1741790626.txt.gz · Last modified: 2025/03/12 14:43 by dragonlord