# HG changeset patch # User Matti Hamalainen # Date 1365701685 -10800 # Node ID 48b91eabc029344187a0846d9533c69680d80691 # Parent 71205451ef57fd06263a22f42753f8443a8c594b Improve scaling a bit, not completely functional yet. diff -r 71205451ef57 -r 48b91eabc029 game/Engine.java --- a/game/Engine.java Thu Apr 11 20:17:13 2013 +0300 +++ b/game/Engine.java Thu Apr 11 20:34:45 2013 +0300 @@ -297,7 +297,7 @@ { // Draw next piece AffineTransform save = g.getTransform(); - nextPiece.paint(g, 830, 325, 90); + nextPiece.paint(g, G.screenDim.width * 0.85f - 90.0f/2.0f, G.screenDim.height * 0.43f, 90.0f); g.setTransform(save); } } @@ -317,10 +317,11 @@ } // Score + String text = ""+ String.format("%05d", gameScore); + int textWidth = G.metrics[2].stringWidth(text); g.setFont(G.fonts[2]); g.setPaint(Color.white); - g.drawString(""+ String.format("%05d", gameScore), G.screenDim.width - 230, 220); - + g.drawString(text, (G.screenDim.width * 0.85f) - textWidth / 2, G.screenDim.height * 0.3f); } public boolean contains(float x, float y)