zain

  • 2015年9月2日
  • 注册于 2015年3月15日
  • hi @barjed, i'm currious with your project.
    i hope i can see your final result of your game 🙂

    i trying to develop something similar like your game with spine.
    an isometric view with 8 direction of walk. and looks like it'll rapidly blow up the sprite work, like fallen said 🙁

  • Hi retropunk,
    thanks for comeback to this thread again :happy:

    as new learner in Spine-Starling, of course i (maybe us*) would like to see your resolved code after using TexturePacker for centralized AssetManager (starling.utils.AssetManager). And i'm sure the TexturePacker mentioned here is not TexturePacker from Spine, right? (just for make sure).

    Yes, i knew the TexturePacker commonly used by starling's user.

    Just one thing that i really want to know if i use TexturePacker is: is it still possible to use "Meshes" and "Free-form Deformation" feature from Spine in Starling's runtimes?

    So, sure i really would like to see your code 😃
    i want to compare it

    :very excited :rofl: :
    thank before~

    *) us


    see your thread is viewed 2544 times[/i]

  • Dear all,
    I would like to make isometric style character with 8 direction for each character.
    So i need 8 animation design, which means i need 8 skeletons.

    But, Spine's JSON export create 1 set (json, AtlasTexture, and Atlas) for each of my skeleton design.

    1. can't i just pack those AtlasTexture in a single png file and load it at once?

    2. and how about the runtime code in starling for this?

    in the example i just see those 1 set for 1 skeleton.
    https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-starling/spine-starling-example/src/spine

    Thanks before~

  • this is example about how to use AssetManager.as
    http://wiki.starling-framework.org/manu ... management

    i'm still can't find clear solution about how to use Starling's AssetManager with Spine-Starling runtime.
    Instead of use TexturePacker, i'd like to use the original Spine's export format. (tight for TexturePacker lol XP)

    still trying..


    i think it's not a good idea to ask Starling manage Spine's assets
    http://forum.starling-framework.org/topic/assetmanager-for-spine

    but, since atlas and Texture in Spine and Starling quite different, i think i need make a new AssetManager to manage both starling's and spine's assets.
    this's some code i make by using singleton to make easier access the game's assets.

    Assets.as

    package  
    { import flash.utils.Dictionary; import spine.atlas.Atlas; import spine.attachments.AtlasAttachmentLoader; import spine.attachments.AttachmentLoader; import spine.SkeletonData; import spine.SkeletonJson; import spine.starling.StarlingTextureLoader; import starling.textures.Texture; import starling.utils.AssetManager; /** * ... * @author zain */ public class Assets extends AssetManager { private static var instance:Assets; private static var _assets:AssetManager;
    private static var mSkeletonData:Dictionary; public function Assets(singleton:SingletonEnforcer):void { _assets = new AssetManager(); mSkeletonData = new Dictionary(); } /** instance checker */ private static function tryinit():void { if ( instance == null ) instance = new Assets( new SingletonEnforcer() ); } [i]public static function enqueue(...rawAssets):void { tryinit(); _assets.enqueue(rawAssets); } public static function loadQueue(onProgress:Function):void { tryinit(); _assets.loadQueue(onProgress); } public static function getTexture(name:String):Texture { return _assets.getTexture(name); }[/i] //{ === region: Spine Assets === public static function loadSkeletonData(name:String, textureClass:Class, atlasClass:Class, jsonClass:Class ):void { tryinit(); if (name in mSkeletonData) { }else{ var textureLoader:StarlingTextureLoader = new StarlingTextureLoader(new textureClass()); var spineAtlas:Atlas = new Atlas(new atlasClass(), textureLoader); var attachmentLoader:AttachmentLoader = new AtlasAttachmentLoader(spineAtlas); var json:SkeletonJson = new SkeletonJson(attachmentLoader); mSkeletonData[name] = json.readSkeletonData(new jsonClass()); } } public static function getSkeletonData(name:String):SkeletonData { return mSkeletonData[name]; } //} === endregion: Spine Assets === } } class SingletonEnforcer { //nothing }

    just focus on Spine Assets region.
    i'm not use the starling's AssetManager part yet.

    this is some test about the SkeletonData part and how to use my Asset's manager

    skeleton = new SkeletonAnimation(Assets.getSkeletonData("april"), true);
    skeleton.x = 400;
    skeleton.y = 560;
    skeleton.state.setAnimationByName(0, "walk", true);
    
    skeleton2 = new SkeletonAnimation(Assets.getSkeletonData("april"), true);
    skeleton2.x = 800;
    skeleton2.y = 560;
    skeleton2.state.setAnimationByName(0, "run", true);
    
    addChild(skeleton);
    addChild(skeleton2);
    Starling.juggler.add(skeleton);
    Starling.juggler.add(skeleton2);

    and the managed spine's SkeletonData result show nice draw call (only 1 draw call)

    i hope this useful 🙂 :coffee:

  • this post should mark as sticky post or included in https://github.com/EsotericSoftware/spi ... /src/spine as an example.

    As new Spine-Starling user, it's take me a couple days to find out how to manage Spine as Asset in Starling.
    Everyone from as3 use Starling (Stage3D) for optimation, right?

    i hope in the future, Spine will have "Starling" as an option when exporting atlas..

    thanks matulk for pointed it out that Spine's atlas is different than the xml which Starling expects.
    And thanks retropunk for sharing, you all saved my day 🙂

  • i have same needs as colinday. An indie game project with a temporary animator. i would like to know how to revert the license from the animator back to me after the project done. So i can lend the license to the next animator for next project. I don't mind if i can't use spine when i lend it to my animator. I just want to use spine for every project i have. i'm afraid going to be disappointed after bought this license 🙁