[]经验分享:如何控制龙骨动画的播放索引!
package
{
import laya.ani.bone.Skeleton;
import laya.ani.bone.Templet;
import laya.events.Event;
import laya.webgl.WebGL;
public class DragonDemo
{
private var mFactory:Templet;
private var mArmature:Skeleton;
private var index:int;//帧频
private var time:Number;
public function DragonDemo()
{
Laya.init(800,600,WebGL);
index=15;
mFactory=new Templet();
mFactory.on(Event.COMPLETE,this,omTemLoaded);
mFactory.loadAni('NewDragon/NewDragon.sk');
}
private function omTemLoaded():void
{
mArmature=mFactory.buildArmature(0);
Laya.stage.addChild(mArmature);
Laya.stage.on(Event.CLICK,this,onClick);
mArmature.play(0,false);//设置初始位置
mArmature.index=this.index;
mArmature.pos(500,500)
}
private function onClick():void
{
mArmature.play("stand",true);//从初始位置开始继续播放
mArmature.player.currentTime=15 * 1000 / mArmature.player.cacheFrameRate;//
}
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Monica - 知识达人
赞同来自:
Peng - 前端工程师
赞同来自: