public synchronized void render(Canvas canvas) { if (canvas.getWidth() != surfaceWidth || canvas.getHeight() != surfaceHeight) { surfaceWidth = canvas.getWidth(); surfaceHeight = canvas.getHeight(); setWindowScale(); } /* while (surface == null) { try { wait(); } catch(InterruptedException e) {} } */ canvas.save(); canvas.scale(windowScale, windowScale, 0, 0); canvas.drawBitmap(screen, windowX / windowScale, windowY / windowScale, bilinearPaint); canvas.restore(); // HUD - caption, subtitles, buttons if (gameState == GAMESTATE_LEVEL) { moreButtonsAnim(); saveEffectRender(canvas); controls.render(canvas); activeFish.render(canvas, 800 - 96, 480 - 96, surfaceWidth, surfaceHeight); } // window caption renderCaption(canvas); // notifyAll(); }
public void setWindowSize(int width, int height) { windowWidth = width; windowHeight = height; windowCaptionFrameCountdown = windowCaptionDelayFrames; setWindowScale(); controls.resizeToScreen(surfaceWidth, surfaceHeight); canvas.drawARGB(255, 0, 0, 0); }