|
## Playing an animation
|
|
## Playing an animation
|
|
```<placeholder>
|
|
```java
|
|
// Get a hold of the ActiveModel you want to modify
|
|
// Get a hold of the ActiveModel you want to modify
|
|
ActiveModel model = ...
|
|
ActiveModel model = ...
|
|
// Get the model's AnimationHandler
|
|
// Get the model's AnimationHandler
|
... | @@ -9,7 +9,7 @@ handler.playAnimation("attack", 0.3, 0.3, 1, true); |
... | @@ -9,7 +9,7 @@ handler.playAnimation("attack", 0.3, 0.3, 1, true); |
|
```
|
|
```
|
|
|
|
|
|
## Stopping an animation with transition
|
|
## Stopping an animation with transition
|
|
```<placeholder>
|
|
```java
|
|
ActiveModel model = ...
|
|
ActiveModel model = ...
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
// Stop an animation. The model will transition out of the animation smoothly
|
|
// Stop an animation. The model will transition out of the animation smoothly
|
... | @@ -17,7 +17,7 @@ handler.stopAnimation("eating"); |
... | @@ -17,7 +17,7 @@ handler.stopAnimation("eating"); |
|
```
|
|
```
|
|
|
|
|
|
## Stopping an animation immediately
|
|
## Stopping an animation immediately
|
|
```<placeholder>
|
|
```java
|
|
ActiveModel model = ...
|
|
ActiveModel model = ...
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
// Stop an animation. The model will snap right out of the animation
|
|
// Stop an animation. The model will snap right out of the animation
|
... | @@ -25,7 +25,7 @@ handler.forceStopAnimation("eating"); |
... | @@ -25,7 +25,7 @@ handler.forceStopAnimation("eating"); |
|
```
|
|
```
|
|
|
|
|
|
## Using specific animation handler method
|
|
## Using specific animation handler method
|
|
```<placeholder>
|
|
```java
|
|
ActiveModel model = ...
|
|
ActiveModel model = ...
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
if(handler instanceof IStateMachineHandler stateMachineHandler) {
|
|
if(handler instanceof IStateMachineHandler stateMachineHandler) {
|
... | | ... | |