From: fred-boy Date: Sun, 22 Apr 2018 12:09:40 +0000 (+0700) Subject: Fix menu X-Git-Tag: alpha0.2.1~1 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=97e48e8210d34fff0948b4fc83c465b3006b7937;p=cavedroid.git Fix menu --- diff --git a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java index c4dc075..482db61 100644 --- a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java @@ -35,9 +35,12 @@ public class MenuRenderer extends Renderer { @Override public void render() { spriteBatch.begin(); - for (int x=0; x<=getWidth(); x++) - for (int y=0; y<=getHeight(); y++) - spriteBatch.draw(Items.BLOCKS.get("dirt").getTexture(),x*16,y*16); + for (int x=0; x<=getWidth()/16; x++) + for (int y=0; y<=getHeight()/16; y++) { + if (y == 0) spriteBatch.draw(Items.BLOCKS.get("grass").getTexture(), x * 16, y * 16); + else spriteBatch.draw(Items.BLOCKS.get("dirt").getTexture(), x * 16, y * 16); + spriteBatch.draw(Assets.shade,x*16,y*16); + } spriteBatch.draw(Assets.gameLogo, getWidth()/2-Assets.gameLogo.getWidth()/2, 0); for (Button button : buttons) { if (button.getRect().contains(Gdx.input.getX()*getWidth()/GameScreen.getWidth(), @@ -49,7 +52,7 @@ public class MenuRenderer extends Renderer { drawButton(button); } drawString("CaveCraft "+CaveGame.VERSION,0, - getHeight()-Assets.getStringHeight("CaveCraft "+CaveGame.VERSION)*2); + getHeight()-Assets.getStringHeight("CaveCraft "+CaveGame.VERSION)*1.5f); spriteBatch.end(); } }