From 6c9c14d306fee3515fcc9625898be2fbed989e23 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 31 Aug 2022 03:09:20 +0600 Subject: debug label lol --- core/src/com/ilotterytea/maxoning/ui/DebugLabel.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 core/src/com/ilotterytea/maxoning/ui/DebugLabel.java (limited to 'core/src') 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())); + } +} -- cgit v1.2.3