From ed9d530705a6bbe15723ab5d6d437db9db50f2dd Mon Sep 17 00:00:00 2001 From: Jeasonfire Date: Wed, 13 May 2015 22:35:46 +0300 Subject: [PATCH] Added FPS Meter. --- core/src/com/saltosion/gladiator/GladiatorBrawler.java | 2 +- core/src/com/saltosion/gladiator/systems/RenderingSystem.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/com/saltosion/gladiator/GladiatorBrawler.java b/core/src/com/saltosion/gladiator/GladiatorBrawler.java index a2e2cbc..fcd8208 100644 --- a/core/src/com/saltosion/gladiator/GladiatorBrawler.java +++ b/core/src/com/saltosion/gladiator/GladiatorBrawler.java @@ -207,7 +207,7 @@ public class GladiatorBrawler extends ApplicationAdapter { guiManager.getRootNode().addChild(button); TextNode text = new TextNode("test-text", "Test!"); - text.setPosition(0.01f, 0.99f); + text.setPosition(0.8f, 0.5f); guiManager.getRootNode().addChild(text); } diff --git a/core/src/com/saltosion/gladiator/systems/RenderingSystem.java b/core/src/com/saltosion/gladiator/systems/RenderingSystem.java index ef65dae..c46839f 100644 --- a/core/src/com/saltosion/gladiator/systems/RenderingSystem.java +++ b/core/src/com/saltosion/gladiator/systems/RenderingSystem.java @@ -89,6 +89,8 @@ public class RenderingSystem extends EntitySystem { renderEntities(deltaTime); renderGUI(new Vector2(0, 0)); renderDebug(camera); + + drawString("FPS: " + Gdx.graphics.getFramesPerSecond(), new Vector2(camera.position.x - 12, camera.position.y + 8)); renderFont(fontCamera); } @@ -132,8 +134,6 @@ public class RenderingSystem extends EntitySystem { s.draw(batch); } if (node instanceof TextNode) { - Log.info("X: " + position.x); - Log.info("Y: " + position.y); drawString(((TextProperty) node).getText(), new Vector2(position.x * AppUtil.VPHEIGHT_CONST * aspectratio + camera.position.x, position.y * AppUtil.VPHEIGHT_CONST + camera.position.y)); }