com.blastedstudios.gdxworld.util.GDXGame Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of GDXWorld Show documentation
Show all versions of GDXWorld Show documentation
Uploads all artifacts belonging to configuration ':archives'
The newest version!
package com.blastedstudios.gdxworld.util;
import java.util.Stack;
import com.badlogic.gdx.Game;
import com.blastedstudios.gdxworld.ui.AbstractScreen;
public abstract class GDXGame extends Game {
private Stack screenStack = new Stack<>();
public AbstractScreen peekScreen(){
return screenStack.peek();
}
public void pushScreen(AbstractScreen screen){
screenStack.push(screen);
setScreen(screen);
}
public AbstractScreen popScreen(){
AbstractScreen previous = screenStack.pop();
if(!screenStack.isEmpty())
setScreen(screenStack.peek());
return previous;
}
}