你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
cuixueying
赞同来自: asdf131
赞同来自:
mArmature = mFactory.buildArmature(1); mArmature.play(0,true); Laya.stage.addChild(mArmature); mArmature.pos(300,600); var rect:Rectangle=new Rectangle(-420,-680,420,680); mArmature.hitArea=rect; mArmature.on(Event.CLICK,this,onClick);
asdf131
该问题目前已经被锁定, 无法添加新回复
7 个回复
cuixueying
赞同来自: asdf131
cuixueying
赞同来自: asdf131
看下这个是你想要的效果吗,如果是,下载附件即可,里面有简单的注释
动画播放完,如果你不需要了,需要清理,可以参考:https://ask.layabox.com/question/3840
cuixueying
赞同来自:
建议开发者可以直接使用hitArea来设置龙骨动画的点击区域
首先通过getBounds获取龙骨动画的width和height(可以通过延迟timer来获取)
然后这是龙骨的hitArea(-width,-height,width,height)
参考示例:
asdf131
赞同来自:
this.mArmature = this.mFactory.buildArmature(0);
this.mArmatureSpr.addChild(this.mArmature);
this.mArmature.on(Laya.Event.LABEL, this, this.onEvent);
this.mArmature.on(Laya.Event.STOPPED, this, this.completeHandler);
this.play();
let bound: Laya.Rectangle = this.mArmature.getBounds();
this.mArmature.x = bound.width;//this.mStartX;
this.mArmature.y = bound.height;//this.mStartY;
// this.mArmature.pivot((bound.width / 2) | 0, (bound.height / 2) | 0)//(图2)
这样不行!
cuixueying
赞同来自:
asdf131
赞同来自:
asdf131
赞同来自: