mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-26 03:31:24 +08:00
AnimationStateTest
This commit is contained in:
parent
d6e7ae7a4a
commit
a2f6e5006d
@ -54,10 +54,11 @@ public class AnimationStateTest extends ApplicationAdapter {
|
|||||||
walkAnimation = json.readAnimation(Gdx.files.internal("spineboy-walk.json"), skeletonData);
|
walkAnimation = json.readAnimation(Gdx.files.internal("spineboy-walk.json"), skeletonData);
|
||||||
jumpAnimation = json.readAnimation(Gdx.files.internal("spineboy-jump.json"), skeletonData);
|
jumpAnimation = json.readAnimation(Gdx.files.internal("spineboy-jump.json"), skeletonData);
|
||||||
|
|
||||||
state = new AnimationState();
|
// Define mixing between animations.
|
||||||
// Define mixing from one animation to another.
|
AnimationStateData mixing = new AnimationStateData();
|
||||||
state.setMixing(walkAnimation, jumpAnimation, 0.4f);
|
mixing.setMixing(walkAnimation, jumpAnimation, 0.4f);
|
||||||
// Set current animation.
|
|
||||||
|
state = new AnimationState(mixing);
|
||||||
state.setAnimation(walkAnimation, true);
|
state.setAnimation(walkAnimation, true);
|
||||||
|
|
||||||
skeleton = new Skeleton(skeletonData);
|
skeleton = new Skeleton(skeletonData);
|
||||||
@ -70,7 +71,7 @@ public class AnimationStateTest extends ApplicationAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void render () {
|
public void render () {
|
||||||
state.update(Gdx.graphics.getDeltaTime());
|
state.update(Gdx.graphics.getDeltaTime() / 3);
|
||||||
|
|
||||||
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
|
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
|
||||||
batch.begin();
|
batch.begin();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
goblins.png
|
goblins.png
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Linear,Linear
|
||||||
repeat: none
|
repeat: none
|
||||||
goblin/spear
|
goblin/spear
|
||||||
rotate: false
|
rotate: false
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
spineboy.png
|
spineboy.png
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Linear,Linear
|
||||||
repeat: none
|
repeat: none
|
||||||
head
|
head
|
||||||
rotate: false
|
rotate: false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user