A
AC Question
i faced a problem that when i devloping live wallpaper at testing on a device it shows stopping while it falling the snow
i am using In
public void drawSnow(Canvas canvas, Paint paint){
Matrix matrix = new Matrix();
matrix.reset();
matrix.postTranslate(-bitmap.getWidth() / 2, -bitmap.getHeight() / 2); // Centers image
matrix.postRotate(angle);
float px=x+bitmap.getHeight()/2;
float py=y+bitmap.getWidth()/2;
matrix.postTranslate(px, py);
canvas.drawBitmap(bitmap, matrix, paint);
}
(in Snow class)
public void handleFalling(boolean fallingDown){
if(fallingDown){
this.y += this.speedY;
this.x += this.xOffset;
angle=angle+2;
if(this.y >= this.heightBound){
this.y = -this.bitmap.getHeight();
this.x = rawX;
System.gc();
}
}else{
angle=angle+2;
this.y -= this.speedY;
this.x += this.xOffset;
if(this.y <= -this.bitmap.getHeight()){
this.y = this.heightBound;
this.x = rawX;
System.gc();
}
}
}
(in same class)
But still it shows some flickering effect
If any one have any suggestion
Plz-Send the solution-bishnu.oca22@gmail.com
i am using In
public void drawSnow(Canvas canvas, Paint paint){
Matrix matrix = new Matrix();
matrix.reset();
matrix.postTranslate(-bitmap.getWidth() / 2, -bitmap.getHeight() / 2); // Centers image
matrix.postRotate(angle);
float px=x+bitmap.getHeight()/2;
float py=y+bitmap.getWidth()/2;
matrix.postTranslate(px, py);
canvas.drawBitmap(bitmap, matrix, paint);
}
(in Snow class)
public void handleFalling(boolean fallingDown){
if(fallingDown){
this.y += this.speedY;
this.x += this.xOffset;
angle=angle+2;
if(this.y >= this.heightBound){
this.y = -this.bitmap.getHeight();
this.x = rawX;
System.gc();
}
}else{
angle=angle+2;
this.y -= this.speedY;
this.x += this.xOffset;
if(this.y <= -this.bitmap.getHeight()){
this.y = this.heightBound;
this.x = rawX;
System.gc();
}
}
}
(in same class)
But still it shows some flickering effect
If any one have any suggestion
Plz-Send the solution-bishnu.oca22@gmail.com