summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2022-08-31 03:09:20 +0600
committerilotterytea <iltsu@alright.party>2022-08-31 03:09:20 +0600
commit6c9c14d306fee3515fcc9625898be2fbed989e23 (patch)
treec6837fc4cb9d6b3ec2d07ac5838ecf22a9d70182
parent175b5826c8dcc1c0a6562a2d63e16d55ea169bb3 (diff)
debug label lol
-rw-r--r--core/src/com/ilotterytea/maxoning/ui/DebugLabel.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/ui/DebugLabel.java b/core/src/com/ilotterytea/maxoning/ui/DebugLabel.java
new file mode 100644
index 0000000..9300962
--- /dev/null
+++ b/core/src/com/ilotterytea/maxoning/ui/DebugLabel.java
@@ -0,0 +1,18 @@
+package com.ilotterytea.maxoning.ui;
+
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.scenes.scene2d.ui.Label;
+import com.badlogic.gdx.scenes.scene2d.ui.Skin;
+import com.ilotterytea.maxoning.MaxonConstants;
+
+public class DebugLabel extends Label {
+ private static final String str_placeholder = "%s\n%s fps";
+
+ public DebugLabel(Skin skin) {
+ super(String.format(str_placeholder, MaxonConstants.GAME_VERSION, Gdx.graphics.getFramesPerSecond()), skin);
+ }
+
+ @Override public void act(float delta) {
+ super.setText(String.format(str_placeholder, MaxonConstants.GAME_VERSION, Gdx.graphics.getFramesPerSecond()));
+ }
+}