|
|
WIP |
|
|
\ No newline at end of file |
|
|
## Playing an animation
|
|
|
```<placeholder>
|
|
|
// Get a hold of the ActiveModel you want to modify
|
|
|
ActiveModel model = ...
|
|
|
// Get the model's AnimationHandler
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
// Play an animation
|
|
|
handler.playAnimation("attack", 0.3, 0.3, 1, true);
|
|
|
```
|
|
|
|
|
|
## Stopping an animation with transition
|
|
|
```<placeholder>
|
|
|
ActiveModel model = ...
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
// Stop an animation. The model will transition out of the animation smoothly
|
|
|
handler.stopAnimation("eating");
|
|
|
```
|
|
|
|
|
|
## Stopping an animation immediately
|
|
|
```<placeholder>
|
|
|
ActiveModel model = ...
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
// Stop an animation. The model will snap right out of the animation
|
|
|
handler.forceStopAnimation("eating");
|
|
|
```
|
|
|
|
|
|
## Using specific animation handler method
|
|
|
```<placeholder>
|
|
|
ActiveModel model = ...
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
if(handler instanceof IStateMachineHandler stateMachineHandler) {
|
|
|
// Using special stop animation method from IStateMachineHandler
|
|
|
stateMachineHandler.stopAnimation(1, "eating");
|
|
|
}else {
|
|
|
// Fallback animation stopping with default method
|
|
|
handler.stopAnimation("eating");
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |