[]Laya.timer.frameLoop(1, this, this.aaa);对象移动会出现颤抖现象
this.loadHp();
Laya.timer.frameLoop(1, this, this.aaa);
private bb:number = 6;
private playerHB:logic.UI.role.PlayerHealthBar;
private loadHp():void
{
this.playerHB = new logic.UI.role.PlayerHealthBar();
this.playerHB.pivotX = this.playerHB.width / 2;
this.playerHB.pivotY = this.playerHB.height / 2;
this.playerHB.y = 500;
this.playerHB.txtName.text = "搞个毛啊"; // this.playerVO.name;
this.addChild(this.playerHB);
}
private aaa():void
{
this.playerHB.x += this.bb;
console.log( this.playerHB.x);
if(this.playerHB.x > 1000)
{
this.bb *= -1;
}
if(this.playerHB.x < -100)
{
this.bb *= -1;
}
}
控制一直6像素来回移动 它就会出现颤抖 不管几像素都会
Laya.timer.frameLoop(1, this, this.aaa);
private bb:number = 6;
private playerHB:logic.UI.role.PlayerHealthBar;
private loadHp():void
{
this.playerHB = new logic.UI.role.PlayerHealthBar();
this.playerHB.pivotX = this.playerHB.width / 2;
this.playerHB.pivotY = this.playerHB.height / 2;
this.playerHB.y = 500;
this.playerHB.txtName.text = "搞个毛啊"; // this.playerVO.name;
this.addChild(this.playerHB);
}
private aaa():void
{
this.playerHB.x += this.bb;
console.log( this.playerHB.x);
if(this.playerHB.x > 1000)
{
this.bb *= -1;
}
if(this.playerHB.x < -100)
{
this.bb *= -1;
}
}
控制一直6像素来回移动 它就会出现颤抖 不管几像素都会
要回复问题请先登录
2 个回复
Aar0n
赞同来自:
Aar0n
赞同来自: