Skip to content

Instantly share code, notes, and snippets.

@gwpantazes
Created October 9, 2016 05:18
Show Gist options
  • Save gwpantazes/c5d6867e27c2b181377ed1120b7d8cfb to your computer and use it in GitHub Desktop.
Save gwpantazes/c5d6867e27c2b181377ed1120b7d8cfb to your computer and use it in GitHub Desktop.
Why is setScreen broken?
package com.my.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Game; // This import is reported as unused, but is needed for setScreen?
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class Main extends ApplicationAdapter {
public SpriteBatch batch;
public BitmapFont font;
@Override
public void create() {
batch = new SpriteBatch();
font = new BitmapFont();
this.setScreen(new MainMenuScreen(this)); // setScreen isn't found?
}
@Override
public void render(){
super.render();
}
@Override
public void dispose() {
batch.dispose();
font.dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment