summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db8aab7)
raw | patch | inline | side by side (parent: db8aab7)
author | fred-boy <fred-boy@protonmail.com> | |
Sun, 22 Apr 2018 12:09:40 +0000 (19:09 +0700) | ||
committer | fred-boy <fred-boy@protonmail.com> | |
Sun, 22 Apr 2018 12:09:40 +0000 (19:09 +0700) |
core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java | patch | blob | history |
diff --git a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java
index c4dc075853cc17742802c8cc9b58ca38cd8ef01f..482db61499fe5b5e1b6a902c14f65a944526e09b 100644 (file)
@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(),
drawButton(button);
}
drawString("CaveCraft "+CaveGame.VERSION,0,
- getHeight()-Assets.getStringHeight("CaveCraft "+CaveGame.VERSION)*2);
+ getHeight()-Assets.getStringHeight("CaveCraft "+CaveGame.VERSION)*1.5f);
spriteBatch.end();
}
}