import Character from "./Character";

export default class SkeletonAni{
    constructor(){
        this.init();
    }
    skeleton:Laya.Skeleton;
    private init():void
    {
        var skeleton=new Laya.Skeleton();
        skeleton.addComponent(Character);
        
        this.skeleton = skeleton;
        skeleton.load("res/NPC_PuTongKeRen1/putongkeren.sk",
                    Laya.Handler.create(this,this._complete));
        skeleton.pos(300,700);
        Laya.stage.addChild(skeleton);
        this.skeleton.scaleX = -1;//设置镜像反转
    }
    private _complete():void{
        this.skeleton.playbackRate(2);//设置动画播放速度
        this.skeleton.play("zc_walk",true);
    }
}
//playbackRate()设置动画播放速度,需要加载完设置才管用

Laya 骨骼动画播放

Laya 骨骼动画播放

 

 spin的json配置文件里 anmations就是动作,站立,行走,等等

 有四个文件的是spin骨骼动画,有两个文件(sk,png)是龙骨骨骼动画

 

相关文章:

  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-02-14
  • 2021-10-16
  • 2022-01-01
猜你喜欢
  • 2022-01-07
  • 2021-08-20
  • 2022-01-06
相关资源
相似解决方案