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()设置动画播放速度,需要加载完设置才管用


spin的json配置文件里 anmations就是动作,站立,行走,等等
有四个文件的是spin骨骼动画,有两个文件(sk,png)是龙骨骨骼动画