Jump to content

Starling AS3 with Bones


filharvey

Recommended Posts

  • 2 weeks later...
  • 3 weeks later...
  • 2 weeks later...

Hi, i am trying to use your Spriter class but i can't get anything to appear on stage, I must be doing something wrong, can you please point me in right direction.


package game
{
import com.acemobe.spriter.Spriter;
import starling.display.MovieClip;
import starling.events.EnterFrameEvent;
import starling.events.Event;
import starling.animation.Juggler;
import starling.core.Starling;
import starling.display.Sprite;
import starling.text.TextField;
import starling.textures.Texture;
import starling.textures.TextureAtlas;

public class rootClass extends Sprite
{
[Embed(source="../../lib/test_sprite/player.scml",mimeType="application/octet-stream")]
private var test_anim:Class;

[Embed(source="../../lib/test_sprite/test.xml",mimeType="application/octet-stream")]
private var test_xml:Class;

[Embed(source="../../lib/test_sprite/test.png")]
private var atlas:Class;

private var player:Spriter;

public function rootClass()
{

var texture:Texture = Texture.fromEmbeddedAsset(atlas);

var xml:XML = XML(new test_xml());
var data:XML = XML(new test_anim());
var _atlas:TextureAtlas = new TextureAtlas(texture, xml);

player = new Spriter("player", data, _atlas, ["player"], ["walk"]);
player.playAnim("walk");
addChild(player);

Starling.juggler.add(player);

addEventListener(EnterFrameEvent.ENTER_FRAME, loop);
}

private function loop(e:EnterFrameEvent):void
{
Starling.juggler.advanceTime(e.passedTime);
}

}

}

atlas xml sample:






...

also tried






scml sample:






i used texture packer to make atlas and xml data..

i am trying to play example Spriter file, if trace(time) from Spriter.as i can see it's advancing and anim == true but nothing is appearing on screen :/

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...