Skip to content

Commit

Permalink
Make the game over text automatically resize
Browse files Browse the repository at this point in the history
  • Loading branch information
tpcstld committed Apr 19, 2015
1 parent fe05cbe commit b464792
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,19 @@ private void getLayout(int width, int height) {
1000f * (widthWithPadding / (paint.measureText(getResources().getString(R.string.instructions)))),
textSize / 1.5f
);
gameOverTextSize = Math.min(
Math.min(
1000f * ((widthWithPadding - gridWidth * 2) / (paint.measureText(getResources().getString(R.string.game_over)))),
textSize * 2
),
1000f * ((widthWithPadding - gridWidth * 2) / (paint.measureText(getResources().getString(R.string.you_win))))
);

paint.setTextSize(cellSize);
cellTextSize = textSize;
titleTextSize = textSize / 3;
bodyTextSize = (int) (textSize / 1.5);
headerTextSize = textSize * 2;
gameOverTextSize = textSize * 2;
textPaddingSize = (int) (textSize / 3);
iconPaddingSize = (int) (textSize / 5);

Expand Down

0 comments on commit b464792

Please sign in to comment.