Skip to content

Commit

Permalink
SpineboyComponent renamed to Spineboy.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed May 13, 2013
1 parent a4bd912 commit fbefc60
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
Expand Down Expand Up @@ -56,6 +58,7 @@ public void create () {
AnimationStateData stateData = new AnimationStateData(skeletonData);
stateData.setMix("walk", "jump", 0.2f);
stateData.setMix("jump", "walk", 0.4f);
stateData.setMix("jump", "jump", 0.2f);

state = new AnimationState(stateData);
state.setAnimation("walk", true);
Expand All @@ -67,6 +70,19 @@ public void create () {
root.setY(20);

skeleton.updateWorldTransform();

Gdx.input.setInputProcessor(new InputAdapter() {
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
keyDown(0);
return true;
}

public boolean keyDown (int keycode) {
state.setAnimation("jump", false);
state.addAnimation("walk", true);
return true;
}
});
}

public void render () {
Expand Down
15 changes: 9 additions & 6 deletions spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,15 @@ public AtlasRegion findRegion (String name) {
skeleton.updateWorldTransform();

Gdx.input.setInputProcessor(new InputAdapter() {
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
keyDown(0);
return true;
}

public boolean keyDown (int keycode) {
if (keycode == Keys.SPACE) {
if (name.equals("goblins")) {
skeleton.setSkin(skeleton.getSkin().getName().equals("goblin") ? "goblingirl" : "goblin");
skeleton.setSlotsToSetupPose();
}
if (name.equals("goblins")) {
skeleton.setSkin(skeleton.getSkin().getName().equals("goblin") ? "goblingirl" : "goblin");
skeleton.setSlotsToSetupPose();
}
return true;
}
Expand All @@ -122,7 +125,7 @@ public void render () {

Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

animation.apply(skeleton, time, true);
animation.apply(skeleton, time, false);
skeleton.updateWorldTransform();
skeleton.update(Gdx.graphics.getDeltaTime());

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit fbefc60

Please sign in to comment.