mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36:56 +08:00
Returned example to use spineboy.
This commit is contained in:
parent
9f19d9af39
commit
9787e7cee7
@ -19,13 +19,13 @@ import starling.textures.Texture;
|
|||||||
import starling.textures.TextureAtlas;
|
import starling.textures.TextureAtlas;
|
||||||
|
|
||||||
public class AtlasExample extends Sprite {
|
public class AtlasExample extends Sprite {
|
||||||
[Embed(source = "goblins.atlas", mimeType = "application/octet-stream")]
|
[Embed(source = "spineboy.atlas", mimeType = "application/octet-stream")]
|
||||||
static public const SpineboyAtlasFile:Class;
|
static public const SpineboyAtlasFile:Class;
|
||||||
|
|
||||||
[Embed(source = "goblins.png")]
|
[Embed(source = "spineboy.png")]
|
||||||
static public const SpineboyAtlasTexture:Class;
|
static public const SpineboyAtlasTexture:Class;
|
||||||
|
|
||||||
[Embed(source = "goblins.json", mimeType = "application/octet-stream")]
|
[Embed(source = "spineboy.json", mimeType = "application/octet-stream")]
|
||||||
static public const SpineboyJson:Class;
|
static public const SpineboyJson:Class;
|
||||||
|
|
||||||
private var skeleton:SkeletonAnimation;
|
private var skeleton:SkeletonAnimation;
|
||||||
@ -36,9 +36,9 @@ public class AtlasExample extends Sprite {
|
|||||||
var skeletonData:SkeletonData = json.readSkeletonData(new SpineboyJson());
|
var skeletonData:SkeletonData = json.readSkeletonData(new SpineboyJson());
|
||||||
|
|
||||||
var stateData:AnimationStateData = new AnimationStateData(skeletonData);
|
var stateData:AnimationStateData = new AnimationStateData(skeletonData);
|
||||||
// stateData.setMixByName("walk", "jump", 0.2);
|
stateData.setMixByName("walk", "jump", 0.2);
|
||||||
// stateData.setMixByName("jump", "walk", 0.4);
|
stateData.setMixByName("jump", "walk", 0.4);
|
||||||
// stateData.setMixByName("jump", "jump", 0.2);
|
stateData.setMixByName("jump", "jump", 0.2);
|
||||||
|
|
||||||
skeleton = new SkeletonAnimation(skeletonData, stateData);
|
skeleton = new SkeletonAnimation(skeletonData, stateData);
|
||||||
skeleton.x = 320;
|
skeleton.x = 320;
|
||||||
@ -58,11 +58,9 @@ public class AtlasExample extends Sprite {
|
|||||||
+ event.data.name + ": " + event.intValue + ", " + event.floatValue + ", " + event.stringValue);
|
+ event.data.name + ": " + event.intValue + ", " + event.floatValue + ", " + event.stringValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
skeleton.skeleton.skinName = "goblin";
|
|
||||||
skeleton.skeleton.setSlotsToSetupPose();
|
|
||||||
skeleton.state.setAnimationByName(0, "walk", true);
|
skeleton.state.setAnimationByName(0, "walk", true);
|
||||||
// skeleton.state.addAnimationByName(0, "jump", false, 3);
|
skeleton.state.addAnimationByName(0, "jump", false, 3);
|
||||||
// skeleton.state.addAnimationByName(0, "walk", true, 0);
|
skeleton.state.addAnimationByName(0, "walk", true, 0);
|
||||||
|
|
||||||
addChild(skeleton);
|
addChild(skeleton);
|
||||||
Starling.juggler.add(skeleton);
|
Starling.juggler.add(skeleton);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ public class Main extends Sprite {
|
|||||||
private var _starling:Starling;
|
private var _starling:Starling;
|
||||||
|
|
||||||
public function Main () {
|
public function Main () {
|
||||||
_starling = new Starling(GoblinsExample, stage);
|
_starling = new Starling(AtlasExample, stage);
|
||||||
_starling.start();
|
_starling.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Loading…
x
Reference in New Issue
Block a user