2021-05-14 10:35:13 +00:00
|
|
|
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;
|
2021-05-14 12:58:14 +00:00
|
|
|
import com.badlogic.gdx.audio.Sound;
|
|
|
|
import sagittarius.view.ButtonSounded.*;
|
2021-05-14 10:35:13 +00:00
|
|
|
|
|
|
|
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);
|
2021-05-14 13:15:02 +00:00
|
|
|
SagittariusGame.music.setVolume(SagittariusGame.musicVolume);
|
2021-05-14 10:35:13 +00:00
|
|
|
SagittariusGame.music.play();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Gdx.input.setInputProcessor(uiStage);
|
|
|
|
|
|
|
|
// Table creation
|
|
|
|
VisTable table = new VisTable(true);
|
|
|
|
table.setFillParent(true);
|
|
|
|
uiStage.addActor(table);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// go back button
|
2021-05-14 12:58:14 +00:00
|
|
|
ButtonTextSounded returnButton = new ButtonTextSounded("Go Back");
|
2021-05-14 10:35:13 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|