31 lines
589 B
Java
31 lines
589 B
Java
package sagittarius.model;
|
|
|
|
import com.badlogic.gdx.Gdx;
|
|
import com.badlogic.gdx.scenes.scene2d.Stage;
|
|
|
|
public class FPS extends BaseActor {
|
|
|
|
// ---------- ATTRIBUTEs ----------
|
|
|
|
private int frameRate;
|
|
|
|
// ---------- METHODs ----------
|
|
|
|
public FPS(Stage stage) {
|
|
super();
|
|
setPosition(3, stage.getViewport().getWorldHeight() - 3);
|
|
}
|
|
|
|
@Override
|
|
public void act(float delta) {
|
|
super.act(delta);
|
|
frameRate = Gdx.graphics.getFramesPerSecond();
|
|
}
|
|
|
|
@Override
|
|
protected String getInfo() {
|
|
return frameRate + " fps";
|
|
}
|
|
|
|
}
|