我缩放画布以适应所有设备屏幕,
但是在缩放背景后,对象显示出像素和模糊
我如何保持规模但解决了这个问题呢?
谢谢你的帮助!
代码:
public void draw(Canvas canvas)
{
final float scaleFactorX = getWidth()/(WIDTH*1.f);
final float scaleFactorY = getHeight()/(HEIGHT*1.f);
if(canvas!=null) {
final int savedState = canvas.save();
canvas.scale(scaleFactorX, scaleFactorY);
bg.draw(canvas);
btn.draw(canvas);
if(!dissapear) {
player.draw(canvas);
}