From 792296717939ac50df33865ae3acbb010e812ad1 Mon Sep 17 00:00:00 2001 From: fred-boy Date: Sun, 22 Apr 2018 16:37:18 +0700 Subject: [PATCH] Optimize font --- android/assets/buttons.png | Bin 0 -> 9608 bytes android/assets/font.fnt | 192 +++++++++--------- android/assets/font.png | Bin 3097 -> 3900 bytes .../src/ru/deadsoftware/cavecraft/Assets.java | 72 +++++-- .../ru/deadsoftware/cavecraft/GameScreen.java | 17 +- .../ru/deadsoftware/cavecraft/GameState.java | 1 + .../cavecraft/InputHandlerMenu.java | 17 +- .../ru/deadsoftware/cavecraft/Renderer.java | 13 +- .../cavecraft/game/GameInput.java | 5 + .../deadsoftware/cavecraft/game/GameProc.java | 16 +- .../cavecraft/game/GameRenderer.java | 53 +---- .../cavecraft/menu/MenuRenderer.java | 43 +++- .../cavecraft/menu/objects/Button.java | 53 +++++ 13 files changed, 306 insertions(+), 176 deletions(-) create mode 100644 android/assets/buttons.png diff --git a/android/assets/buttons.png b/android/assets/buttons.png new file mode 100644 index 0000000000000000000000000000000000000000..85280145266dfeec22639de196235b9e66315d18 GIT binary patch literal 9608 zcmV;3C3o71P))P)ih1M4$si9 zrfI}lE8Dh7(=^3ccs)c!E|*Jw|E;+-O_SGU+qUAKyiR&Oc&^r3vDV76EDz7Z{q?>) zyXLJI<{m=GW8(Gad1zVTXW?32!)I%Q`|w^pyY|`r_I=NLhWY>TkAF-Gf`?dZ^ToVz zJWyQo*5W|`u-M-FyfFK|XC=#8>RjGXysv-81hfLN62}36j{)n&*W($y&bTM$!1H6_Wg~?Dmu1Ncz-z&Z6hg?? zupqI)!*gpw%lpgg%!Y)G8Rm_3<2~Vf#u&wWFCm0%oV5Hw_V}6F@My)ud(Js&nnpqh z#eHi=9R?QrCn91+N-E$ zBPazFf#-qG)Vv1^A1fKJJ9{b!9TX4i%4>>wvk_sXVByF7ATK;O9v6R>_gotr804B# zKJ!349<1?S|N7TQ4}w9luxa7t2Sb3gRfTXupxC<9UaSBy#zHaRW#GD5h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5CF7p z390FNiUa_eR~Tnn>spTiSe}z>b=Y@lVAKF$w_=Ih%p%)LZhxoMz`JY!aL?slOS=GW zfyy;A3!v8$u9wV{*kCu*(OXf@en)&s*Ha__$o7M`3;+y#LkmD<3&6Y&FVh0>b!{|v zgC_dY03cEUT~?q{)>q|TIN#7dex7Slkf!}yt%P#=W9RMsn+q(c-&4F&wPd?JS01jsXv%w2v1C!7TSs3ud{s(#toLFMN RT;Biy002ovPDHLkV1h?RBT@hW diff --git a/core/src/ru/deadsoftware/cavecraft/Assets.java b/core/src/ru/deadsoftware/cavecraft/Assets.java index 427ebc6..6a992ef 100644 --- a/core/src/ru/deadsoftware/cavecraft/Assets.java +++ b/core/src/ru/deadsoftware/cavecraft/Assets.java @@ -3,6 +3,7 @@ package ru.deadsoftware.cavecraft; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; +import com.badlogic.gdx.graphics.g2d.GlyphLayout; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -10,11 +11,16 @@ public class Assets { public static final int BLOCK_TEXTURES = 18; + private static GlyphLayout layout; + public static BitmapFont minecraftFont; public static Sprite gameLogo; - public static Texture charTexture; + public static Texture menuButtonTexture; + public static TextureRegion[] menuButton = new TextureRegion[3]; + + public static Texture playerTexture; public static Sprite[][] playerSprite = new Sprite[2][4]; public static Texture pigTexture; @@ -41,32 +47,32 @@ public class Assets { public static TextureRegion touchSpace; private static void loadPlayer() { - charTexture = new Texture(Gdx.files.internal("mobs/char.png")); + playerTexture = new Texture(Gdx.files.internal("mobs/char.png")); //LOOK TO LEFT //head - playerSprite[0][0] = new Sprite(new TextureRegion(charTexture, 0,0,12,12)); + playerSprite[0][0] = new Sprite(new TextureRegion(playerTexture, 0,0,12,12)); playerSprite[0][0].flip(false,true); //body - playerSprite[0][1] = new Sprite(new TextureRegion(charTexture, 0,13,12,12)); + playerSprite[0][1] = new Sprite(new TextureRegion(playerTexture, 0,13,12,12)); playerSprite[0][1].flip(false,true); //hand - playerSprite[0][2] = new Sprite(new TextureRegion(charTexture, 25,5,20,20)); + playerSprite[0][2] = new Sprite(new TextureRegion(playerTexture, 25,5,20,20)); playerSprite[0][2].flip(false,true); //leg - playerSprite[0][3] = new Sprite(new TextureRegion(charTexture, 25,27,20,20)); + playerSprite[0][3] = new Sprite(new TextureRegion(playerTexture, 25,27,20,20)); playerSprite[0][3].flip(false,true); //LOOK TO RIGHT //head - playerSprite[1][0] = new Sprite(new TextureRegion(charTexture, 13,0,12,12)); + playerSprite[1][0] = new Sprite(new TextureRegion(playerTexture, 13,0,12,12)); playerSprite[1][0].flip(false,true); //body - playerSprite[1][1] = new Sprite(new TextureRegion(charTexture, 13,13,12,12)); + playerSprite[1][1] = new Sprite(new TextureRegion(playerTexture, 13,13,12,12)); playerSprite[1][1].flip(false,true); //hand - playerSprite[1][2] = new Sprite(new TextureRegion(charTexture, 37,5,20,20)); + playerSprite[1][2] = new Sprite(new TextureRegion(playerTexture, 37,5,20,20)); playerSprite[1][2].flip(false,true); //leg - playerSprite[1][3] = new Sprite(new TextureRegion(charTexture, 37,27,20,20)); + playerSprite[1][3] = new Sprite(new TextureRegion(playerTexture, 37,27,20,20)); playerSprite[1][3].flip(false,true); } @@ -84,9 +90,19 @@ public class Assets { public static void load() { minecraftFont = new BitmapFont(Gdx.files.internal("font.fnt"), true); + minecraftFont.getData().setScale(.375f); + + layout = new GlyphLayout(); + gameLogo = new Sprite(new Texture(Gdx.files.internal("gamelogo.png"))); gameLogo.flip(false, true); + menuButtonTexture = new Texture(Gdx.files.internal("buttons.png")); + for (int i=0; i<3; i++) { + menuButton[i] = new TextureRegion(menuButtonTexture, 0, 20*i, 200, 20); + menuButton[i].flip(false, true); + } + loadPlayer(); loadPig(); @@ -103,19 +119,21 @@ public class Assets { creativeScroll = new TextureRegion(creativeTexture, 3, 137, 12, 15); creativeScroll.flip(false, true); - touchGui = new Texture(Gdx.files.internal("touch_gui.png")); - for (int i=0; i<4; i++) { - touchArrows[i] = new TextureRegion(touchGui, i*26, 0, 26,26); - touchArrows[i].flip(false, true); + if (CaveGame.TOUCH) { + touchGui = new Texture(Gdx.files.internal("touch_gui.png")); + for (int i = 0; i < 4; i++) { + touchArrows[i] = new TextureRegion(touchGui, i * 26, 0, 26, 26); + touchArrows[i].flip(false, true); + } + touchLMB = new TextureRegion(touchGui, 0, 26, 26, 26); + touchLMB.flip(false, true); + touchRMB = new TextureRegion(touchGui, 52, 26, 26, 26); + touchRMB.flip(false, true); + touchToggleMode = new TextureRegion(touchGui, 26, 26, 26, 26); + touchToggleMode.flip(false, true); + touchSpace = new TextureRegion(touchGui, 0, 52, 104, 26); + touchSpace.flip(false, true); } - touchLMB = new TextureRegion(touchGui, 0, 26, 26,26); - touchLMB.flip(false, true); - touchRMB = new TextureRegion(touchGui, 52, 26, 26,26); - touchRMB.flip(false, true); - touchToggleMode = new TextureRegion(touchGui, 26, 26, 26, 26); - touchToggleMode.flip(false, true); - touchSpace = new TextureRegion(touchGui, 0, 52, 104, 26); - touchSpace.flip(false, true); terrain = new Texture(Gdx.files.internal("terrain.png")); for (int i=0; i(); @@ -43,7 +49,13 @@ public class GameProc { } public void resetRenderer() { - renderer = new GameRenderer(this); + if (CaveGame.TOUCH) { + renderer = new GameRenderer(this,320, + 320*((float)GameScreen.getHeight()/GameScreen.getWidth())); + } else { + renderer = new GameRenderer(this,480, + 480*((float)GameScreen.getHeight()/GameScreen.getWidth())); + } } private boolean isAutoselectable(int x, int y) { diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java index e64ed13..a1a4c66 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java @@ -14,38 +14,10 @@ public class GameRenderer extends Renderer{ private GameProc gameProc; - public OrthographicCamera fontCam; - SpriteBatch fontBatch; - - public GameRenderer(GameProc gameProc) { + public GameRenderer(GameProc gameProc,float width, float heigth) { + super(width,heigth); Gdx.gl.glClearColor(0f,.6f,.6f,1f); this.gameProc = gameProc; - camera = new OrthographicCamera(); - if (!CaveGame.TOUCH) { - camera.setToOrtho(true, 480, - 480 * ((float) GameScreen.getHeight() / GameScreen.getWidth())); - } else { - camera.setToOrtho(true, 320, - 320 * ((float) GameScreen.getHeight() / GameScreen.getWidth())); - } - shapeRenderer = new ShapeRenderer(); - shapeRenderer.setProjectionMatrix(camera.combined); - shapeRenderer.setAutoShapeType(true); - spriteBatch = new SpriteBatch(); - spriteBatch.setProjectionMatrix(camera.combined); - - fontCam = new OrthographicCamera(); - fontCam.setToOrtho(true, GameScreen.getWidth(), GameScreen.getHeight()); - fontBatch = new SpriteBatch(); - fontBatch.setProjectionMatrix(fontCam.combined); - } - - private void setFontColor(int r, int g, int b) { - Assets.minecraftFont.setColor(r/255f, g/255f, b/255f, 1f); - } - - private void drawString(String str, float x, float y) { - Assets.minecraftFont.draw(fontBatch, str, x, y); } private void drawWorldBackground() { @@ -209,23 +181,18 @@ public class GameRenderer extends Renderer{ drawCreative(); break; } - spriteBatch.end(); - if (CaveGame.TOUCH) { - spriteBatch.begin(); - drawTouchGui(); - spriteBatch.end(); - } + if (CaveGame.TOUCH) drawTouchGui(); - fontBatch.begin(); setFontColor(255,255,255); drawString("CaveCraft "+CaveGame.VERSION, 0, 0); - drawString("FPS: "+GameScreen.FPS, 0, 20); - drawString("X: "+(int)(gameProc.player.position.x/16), 0, 40); - drawString("Y: "+(gameProc.world.getHeight()-(int)(gameProc.player.position.y/16)), 0, 60); - drawString("Seed: "+WorldGen.getSeed(), 0, 80); - drawString("Mobs: "+gameProc.mobs.size, 0, 100); - fontBatch.end(); + drawString("FPS: "+GameScreen.FPS, 0, 12); + drawString("X: "+(int)(gameProc.player.position.x/16), 0, 24); + drawString("Y: "+(gameProc.world.getHeight()-(int)(gameProc.player.position.y/16)), 0, 36); + drawString("Seed: "+WorldGen.getSeed(), 0, 48); + drawString("Mobs: "+gameProc.mobs.size, 0, 60); + + spriteBatch.end(); } } diff --git a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java index 0f8011d..76f2355 100644 --- a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java @@ -1,14 +1,34 @@ package ru.deadsoftware.cavecraft.menu; -import ru.deadsoftware.cavecraft.Assets; -import ru.deadsoftware.cavecraft.GameScreen; -import ru.deadsoftware.cavecraft.Items; -import ru.deadsoftware.cavecraft.Renderer; +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.utils.Array; +import ru.deadsoftware.cavecraft.*; +import ru.deadsoftware.cavecraft.menu.objects.Button; public class MenuRenderer extends Renderer { - public MenuRenderer() { - super(480,480*((float) GameScreen.getHeight()/GameScreen.getWidth())); + public Array