package sagittarius.view; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener; import com.kotcrab.vis.ui.VisUI; import com.kotcrab.vis.ui.widget.VisTable; import com.kotcrab.vis.ui.widget.VisTextButton; import sagittarius.SagittariusGame; public class CreditScreen extends BaseScreen { @Override public void initialize() { // A music is played if (!SagittariusGame.disableMusic){ SagittariusGame.music.stop(); SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/music/credit_music.mp3")); SagittariusGame.music.setLooping(true); SagittariusGame.music.play(); } Gdx.input.setInputProcessor(uiStage); // Table creation VisTable table = new VisTable(true); table.setFillParent(true); uiStage.addActor(table); // go back button VisTextButton returnButton = new VisTextButton("Go Back"); returnButton.addListener(new ActorGestureListener() { @Override public void tap(InputEvent event, float x, float y, int count, int button) { super.tap(event, x, y, count, button); SagittariusGame.setActiveScreen( new StartScreen() ); } }); table.add(returnButton).width(150); table.row(); } @Override public void update(float dt) { // nothing (?) } @Override public void dispose() { VisUI.dispose(); super.dispose(); } }