summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a97e7d5)
raw | patch | inline | side by side (parent: a97e7d5)
author | fred-boy <fred-boy@protonmail.com> | |
Sun, 22 Apr 2018 11:58:09 +0000 (18:58 +0700) | ||
committer | fred-boy <fred-boy@protonmail.com> | |
Sun, 22 Apr 2018 11:58:09 +0000 (18:58 +0700) |
diff --git a/core/src/ru/deadsoftware/cavecraft/Renderer.java b/core/src/ru/deadsoftware/cavecraft/Renderer.java
index 581145aa5cbad7fe2932766aa2733d5270f019e6..928d1fbc88c44263f92154103f4959532b0c3add 100644 (file)
public float getHeight() {return camera.viewportHeight;}
+ public void setFontScale(float scale) {
+ Assets.minecraftFont.getData().setScale(scale);
+ }
+
public void setFontColor(int r, int g, int b) {
Assets.minecraftFont.setColor(r/255f, g/255f, b/255f, 1f);
}
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java
index a1a4c66bd93cd9a6489f0a545929d8fce1fab475..480a63531184b715558da6ff13a22db5abd5f0f2 100644 (file)
if (CaveGame.TOUCH) drawTouchGui();
- setFontColor(255,255,255);
- drawString("CaveCraft "+CaveGame.VERSION, 0, 0);
- 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 76f2355760cbf15245cfb5b8fad6bbc526839f63..c4dc075853cc17742802c8cc9b58ca38cd8ef01f 100644 (file)
private void drawButton(Button button) {
spriteBatch.draw(Assets.menuButton[button.getType()], button.getX(), button.getY());
+ setFontColor(255,255,255);
drawString(button.getLabel(),
(button.getX()+button.getWidth()/2)-Assets.getStringWidth(button.getLabel())/2,
(button.getY()+button.getHeight()/2)-Assets.getStringHeight(button.getLabel())/2);