You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
918 B
42 lines
918 B
11 years ago
|
package mightypork.rogue.screens;
|
||
|
|
||
|
|
||
|
import mightypork.gamecore.gui.renderers.TextPainter;
|
||
|
import mightypork.gamecore.gui.screens.Screen;
|
||
|
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||
|
import mightypork.gamecore.render.DisplaySystem;
|
||
|
import mightypork.gamecore.render.fonts.FontRenderer;
|
||
|
import mightypork.gamecore.render.fonts.FontRenderer.Align;
|
||
|
import mightypork.rogue.Res;
|
||
|
import mightypork.utils.math.color.RGB;
|
||
|
import mightypork.utils.math.coord.Coord;
|
||
|
|
||
|
|
||
|
public class LayerFps extends ScreenLayer {
|
||
|
|
||
|
TextPainter tp;
|
||
|
private FontRenderer fr;
|
||
|
|
||
|
|
||
|
public LayerFps(Screen screen) {
|
||
|
super(screen);
|
||
|
|
||
|
fr = new FontRenderer(Res.getFont("default"), RGB.WHITE);
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void render()
|
||
|
{
|
||
|
Coord pos = new Coord(DisplaySystem.getWidth() - 8, 8);
|
||
|
fr.draw(getDisplay().getFps() + " fps", pos, 32, Align.RIGHT);
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public int getPriority()
|
||
|
{
|
||
|
return Integer.MAX_VALUE;
|
||
|
}
|
||
|
}
|