projet-programmation-orient.../core/src/sagittarius/model/FPS.java
2021-04-13 21:08:25 +02:00

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";
}
}