You should call the render method from your game class. If you dont call it noone will do that for you. You shouldn't override the render method of the game class which you do and you do it empty so it wont call anything for you.
Lets take a look into the Game class. It does implement all methods from the ApplicationListener interface (well not the create()
). So there is no need for you to override anything of it. Simply delete your:
public void render () { }
public void dispose() { super.dispose(); }
public void pause() { super.pause(); }
public void resize(int width, int height) { super.resize(width, height); }
public void resume() { }
and it should work fine. Even though these are useless methods. They do nothing than calling the super class so why you write those. If you have not written that it automatically calls the super methods.
But okay if you want to handle the stuff yourself like calling dispose on a screen or calling the init before you set a new screen you need to write your own "game" class which implements the ApplicationListener
interface.
To give you an idea on how to do this ill post a small example which i use for some tests:
public class MyGameClass implements ApplicationListener {
private Screen curScreen; // the current screen
@Override
public void create(){
Gdx.graphics.getWidth();
Gdx.graphics.getHeight();
Intro temp = new Intro(this);//just an example of the first screen to load up
setScreen(temp);
}
public void setScreen(Screen s) {
if (curScreen != null) {
curScreen.hide();
curScreen.dispose();
}
curScreen = s;
curScreen.show();
curScreen.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
s.init();
}
@Override
public void dispose() {
curScreen.dispose();
}
@Override
public void render() {
curScreen.render(Gdx.graphics.getDeltaTime()); //call the rendermethod with the delta time as parameter
}
@Override
public void resize(int width, int height) {
curScreen.resize(width, height);
}
@Override
public void pause() {
curScreen.pause();
}
@Override
public void resume() {
curScreen.resume();
}
}