Fixes issue with draw fps text

This commit is contained in:
Collin Smith 2019-04-13 04:25:54 -07:00
parent 6576fa4242
commit 1590adce0f

View File

@ -21,10 +21,10 @@ import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.badlogic.gdx.utils.I18NBundle;
import com.badlogic.gdx.utils.Pools;
import com.badlogic.gdx.utils.Scaling;
import com.badlogic.gdx.utils.SnapshotArray;
import com.badlogic.gdx.utils.viewport.ExtendViewport;
@ -117,6 +117,8 @@ public class Client extends Game {
private boolean forceDrawFps;
private byte drawFpsMethod;
private final GlyphLayout fps = new GlyphLayout();
private String realm;
public Client(FileHandle home) {
@ -434,8 +436,7 @@ public class Client extends Game {
BitmapFont font = console.getFont();
if (font == null) return;
GlyphLayout fps = Pools.obtain(GlyphLayout.class);
fps.setText(font, Integer.toString(Gdx.graphics.getFramesPerSecond()));
fps.setText(font, Integer.toString(Gdx.graphics.getFramesPerSecond()), Color.WHITE, 0, Align.left, false);
int drawFpsMethod = this.drawFpsMethod;
if (forceDrawFps && drawFpsMethod == 0) {
drawFpsMethod = 1;
@ -465,7 +466,6 @@ public class Client extends Game {
}
font.draw(b, fps, x, y);
Pools.free(fps);
}
@Override