这是我在Sprite
课堂上的代码:
public class Sprite {
int x, y, vx, vy;
private Bitmap texture;
public Sprite(Bitmap texture) {
this.texture = texture;
}
public int getWidth() {
return texture.getWidth();
}
public int getHeight() {
return texture.getHeight();
}
public void draw(Canvas c) {
c.drawBitmap(texture, x, y, null);
}
}
和background.draw(c);
我一起画一个背景。但是背景比屏幕大...
如何将其缩放到屏幕大小?