egret的spine运行库


spine-egret-runtimes

About

本项目为 白鹭引擎 的 spine 运行库
A spine runtime for Egret
Demo:https://www.bobsong.net/spine-egret-runtimes-example/.

Preview


Installing

See Egret document for integrating to Egret project.

Getting started

private loadSpineAnimation(skeletonName: string) {

    let json = RES.getRes(skeletonName + "_json")
    let atlas = RES.getRes(skeletonName + "_atlas")
    let imgs = {
        [skeletonName + '.png']: RES.getRes(skeletonName + "_png")
    }
    for (var i = 2; i < 5; i++) {
        let img = RES.getRes(skeletonName+i + "_png")
        if(img != null)
        {
            imgs[skeletonName+i + '.png'] = img
        }
        else
        {
            break;
        }
    }

    let texAtlas = spine.createTextureAtlas(atlas, imgs);
    let skelData = spine.createSkeletonData(json, texAtlas);

    return new spine.SkeletonAnimation(skelData);
}

Learn more

Several classes or structures have been added, all be declared within namespace spine to minimize impact.

  • createSkeletonData Helper for creating skeleton data.
  • createTextureAtlas Helper for creating texture atlas.
  • SkeletonAnimation A user-friendly animation manager.
  • SkeletonRenderer A mere skeleton renderer
  • SlotRenderer Slot renderer for SkeletonRenderer.
  • EventEmitter Embbeded implemation of event emitter.
  • SpineEvent Enums of animation events.
  • Track Track abstraction for SkeletonAnimation.

Issues

  • 裁剪未完成
  • drawcall 过高,需要优化(主要颜色滤镜导致)

Git地址

https://github.com/BobSongCN/spine-egret-runtimes

完整示例工程

链接:https://pan.baidu.com/s/1kjXpsisSMoy0pRatoxwA1w 
提取码:ai3q 

声明:小宝笔记|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - egret的spine运行库


Carpe Diem and Do what I like