[]我用的HBox做的进度条为啥总是一闪一闪的。


QQ截图20180615153909.png

我用的Laya.HBox做的这个字体为啥总是一闪一闪的
没有一直显示啊
public onChange(value: number): void {
console.log("进度:" + Math.floor(value * 100) + "%");
var num:number = Math.floor(value*100);
// this.updateFont(num);
this.updateFont(100);
//test用
// if(num==100){
// G.I.loginManager.preload();
// }
}
private hbox:Laya.HBox;
private updateFont(value:number){
if(!this.hbox){
this.hbox = new Laya.HBox();
this.addChild(this.hbox);
}else{
this.hbox.removeChildren();
}
var cout:string = value.toString();
for(var i=0;i<cout.length;i++){
var clip: Laya.Clip = new Laya.Clip("loading/num0-9.png", 10, 1);
clip.index = parseInt(cout.charAt(i));
this.hbox.addChild(clip);
}
var clip_perc:Laya.Clip = new Laya.Clip("loading/num_percent.png", 1, 1);
this.hbox.addChild(clip_perc);
this.hbox.pos(369,445);
this.hbox.refresh();
}
已邀请:

Aar0n

赞同来自:

传个demo 看看

要回复问题请先

商务合作
商务合作