@Override
public void create() {
setScreen(new Screen() {
private final Stage stage = new Stage(new StretchViewport(GAME_VIEWPORT_WIDTH, GAME_VIEWPORT_HEIGHT));
private final BitmapFont bitmapFont = new BitmapFont();
private final Label fps = new Label("", new Label.LabelStyle(bitmapFont, Color.WHITE));
private final Road road = new Road();
@Override
public void render(float v) {
GL20 gl = Gdx.graphics.getGL20();
gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
fps.setText("" + Gdx.graphics.getFramesPerSecond());
road.update(v);
road.render(stage.getCamera());
stage.act();
stage.draw();
}
@Override
public void resize(int i, int i2) {
}
@Override
public void show() {
fps.setFontScale(5F);
stage.addActor(fps);
road.resetRoad();
}
@Override
public void hide() {