egret的spine运行库

spine-egret-runtimes

About

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

Preview

preview.png

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 

本文链接:

https://bobsong.cn/1222.html
1 + 2 =
2 评论
    徐大大Chrome 83OSX
    5月25日 回复

    spine-egret-runtimes项目里的东西现在不能直接运行了是为啥啊,大佬知道吗

    徐大大Chrome 83OSX
    5月25日 回复

    大佬可以更新一下,spine3.8,3.9版本的运行时吗