[]Dragonbones龙骨动画 播放不同动作出现闪烁 混乱
骨络包括几个动画,播放部分动画没问题,但是播放某一个动画出现闪烁
试过0,1,2模式都不行
//加载动画
load(aniUrl: string,emoji?:string,complete?:Handler):void{
if (emoji) {
this.emoji=emoji;
}
if (complete) {
this.completeHandler = complete;
}
this.aniUrl = aniUrl;
this.templet = new Templet();
this.templet.on(Event.COMPLETE, this, this.parseComplete);
// this.templet.on(Event.ERROR, this, this.onError);
this.templet.loadAni(this.aniUrl);
this.maskBox.graphics.drawRect(0,0,this.width,this.height,'#ffffff');
this.mask = this.maskBox;
this.maskBox.alpha=0;
// this.show();
}
private parseComplete():void {
//创建模式为1,可以启用换装
this.skeleton =this.templet.buildArmature(1);
this.skeleton.x = this.mStartX;
this.skeleton.y = this.mStartY;
this.skeleton.scale(this.scaleper, this.scaleper);
if (!this.emojiArr) {
this.emojiArr={};
var emojinum = this.skeleton.getAnimNum();
for (var i = 0; i < emojinum; i++) {
var element = this.skeleton.getAniNameByIndex(i);
this.emojiArr[element]=1;
}
}
if (!this.emojiArr[this.emoji]) {
//如果表情不存在则使用默认第一个
this.emoji = this.skeleton.getAniNameByIndex(0);
}
this.play(this.emoji);
this.addChild(this.skeleton);
this.show();
if (this.completeHandler) {
this.completeHandler.runWith(this);
}
}
//改变表情
public changeEmoji(emoji:string):void{
if (emoji) {
this.emoji=emoji;
}
if (!this.emojiArr || !this.emojiArr[this.emoji]) {
//如果表情不存在则使用默认第一个
this.emoji = this.skeleton.getAniNameByIndex(0);
}
this.play(this.emoji);
}
private play(emoji:string):void{
this.skeleton.play(emoji,true);
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
魂影
赞同来自: 龙印
首先使用DragonBones Tools工具把龙骨动画转为Spine
https://github.com/DragonBones/Tools
然后再使用“Spine动画转换工具”转换得到的文件,播放动画就正常了
希望官方可以修复此问题!