use of com.badlogic.gdx.scenes.scene2d.Stage in project AmazingMaze by TheVirtualMachine.
the class CreditsScreen method setupComponents.
/**
* Instantiate the stage and its actors for the credits screen.
* Add all actors to the stage.
*/
private void setupComponents() {
stage = new Stage();
table = new Table();
table.top();
table.setFillParent(true);
stage.addActor(table);
gameLogo = new Image(game.assets.manager.get(Assets.GAME_LOGO, Texture.class));
header = new Label("", game.assets.skin, Assets.SERIF_HEADER_STYLE);
codeGroup = setupCreditsLabel(CODE, Assets.CREDITS_CONTENTS);
artGroup = setupCreditsLabel(ART, Assets.CREDITS_CONTENTS);
storyGroup = setupCreditsLabel(STORY, Assets.CREDITS_CONTENTS);
musicGroup = setupCreditsLabel(MUSIC, Assets.SMALL_CREDITS_CONTENTS);
thanksGroup = setupCreditsLabel(THANKS, Assets.CREDITS_CONTENTS);
companyLogo = new Image(game.assets.manager.get(Assets.COMPANY_LOGO, Texture.class));
}
use of com.badlogic.gdx.scenes.scene2d.Stage in project AmazingMaze by TheVirtualMachine.
the class MazeScreen method setupPauseMenu.
/** Create the pause menu. */
private void setupPauseMenu() {
pauseMenu = new Stage(new ScreenViewport(), game.batch);
Table table = new Table();
table.setFillParent(true);
table.center();
pauseMenu.addActor(table);
TextButton resumeButton = new TextButton("Resume", game.assets.skin);
resumeButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
paused = false;
}
});
table.add(resumeButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
table.row();
TextButton settingsButton = new TextButton("Settings", game.assets.skin);
final Screen sourceScreen = this;
settingsButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.settingsScreen.setSourceScreen(sourceScreen);
game.setScreen(game.settingsScreen);
}
});
table.add(settingsButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
table.row();
TextButton quitButton = new TextButton("Main Menu", game.assets.skin);
quitButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.setScreen(game.menuScreen);
}
});
table.add(quitButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
}
use of com.badlogic.gdx.scenes.scene2d.Stage in project AmazingMaze by TheVirtualMachine.
the class StoryScreen method setupUI.
/** Helper method to setup the UI. */
private void setupUI() {
stage = new Stage(new ScreenViewport(), game.batch);
table = new Table();
table.top().center();
table.setFillParent(true);
stage.addActor(table);
header = new Label("Story", game.assets.skin, Assets.SERIF_HEADER_STYLE);
table.add(header).padTop(Gdx.graphics.getHeight() / 25f);
storyLabel = new Label(readStory(), game.assets.skin, Assets.STORY_STYLE);
storyLabel.setWrap(true);
table.row();
table.add(storyLabel).maxWidth(Gdx.graphics.getWidth()).prefWidth(Gdx.graphics.getWidth() / 1.125f).pad(Gdx.graphics.getHeight() / 25f);
continueButton = new TextButton("Continue...", game.assets.skin);
continueButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
if (continueButton.isPressed()) {
game.setScreen(new MazeScreen(game, false));
}
}
});
table.row();
table.add(continueButton).width(Gdx.graphics.getWidth() / 4f).pad(Gdx.graphics.getHeight() / 25f).expandY().bottom().fillY();
}
use of com.badlogic.gdx.scenes.scene2d.Stage in project Entitas-Java by Rubentxu.
the class GameSceneState method loadResources.
@Override
public void loadResources() {
this.skinManager = engine.getManager(SMGUIManager.class);
this.assetsManager = engine.getManager(BaseAssetsManager.class);
guiFactory = new GuiFactory(assetsManager, skin);
bodyBuilder = new BodyBuilder();
this.stage = new Stage();
stage.clear();
stage.getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
Gdx.input.setInputProcessor(stage);
Gdx.app.log("Menu", "LoadResources");
assetsManager.loadTextureAtlas(SPRITE_ATLAS);
assetsManager.finishLoading();
}
use of com.badlogic.gdx.scenes.scene2d.Stage in project Entitas-Java by Rubentxu.
the class MenuState method loadResources.
@Override
public void loadResources() {
assetsManager = engine.getManager(BaseAssetsManager.class);
this.stage = new Stage();
mainTable = new Table();
mainTable.setFillParent(true);
stage.clear();
stage.getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
this.stage.addActor(mainTable);
Gdx.input.setInputProcessor(stage);
Gdx.app.log("Menu", "LoadResources");
}
Aggregations