我有以下代码.
this.getGame().getGraphics().drawBitmap(Assets.playScreen_LaserBeamAnimation, new Rect(0, 0, 100, 750), new Rect(0, 0, 100, 750), null);
this.getGame().getGraphics().drawBitmap(Assets.playScreen_LaserBeamAnimation, new Rect(0, 200, 10, 800), new Rect(0, 0, 200, 600), null);
Run Code Online (Sandbox Code Playgroud)
第一个render语句0.6 - 1 second
用于渲染.第二个围绕着1 millisecond
.
位图很大:968 KB
并加载以下代码:
public Bitmap readAssetsBitmap(String filename) throws IOException {
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPurgeable = true;
Bitmap bitmap = BitmapFactory.decodeStream(assets.open(filename), null, options);
if(bitmap == null) {
WSLog.d(Game.GAME_ENGINE_TAG, this,"File cannot be opened: It's value is null");
throw new IOException("File cannot be opened: …
Run Code Online (Sandbox Code Playgroud)