use of com.badlogic.gdx.scenes.scene2d.ui.Table 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.ui.Table 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.ui.Table 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.ui.Table 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");
}
use of com.badlogic.gdx.scenes.scene2d.ui.Table in project libgdx by libgdx.
the class Stage method drawDebug.
private void drawDebug() {
if (debugShapes == null) {
debugShapes = new ShapeRenderer();
debugShapes.setAutoShapeType(true);
}
if (debugUnderMouse || debugParentUnderMouse || debugTableUnderMouse != Debug.none) {
screenToStageCoordinates(tempCoords.set(Gdx.input.getX(), Gdx.input.getY()));
Actor actor = hit(tempCoords.x, tempCoords.y, true);
if (actor == null)
return;
if (debugParentUnderMouse && actor.parent != null)
actor = actor.parent;
if (debugTableUnderMouse == Debug.none)
actor.setDebug(true);
else {
while (actor != null) {
if (actor instanceof Table)
break;
actor = actor.parent;
}
if (actor == null)
return;
((Table) actor).debug(debugTableUnderMouse);
}
if (debugAll && actor instanceof Group)
((Group) actor).debugAll();
disableDebug(root, actor);
} else {
if (debugAll)
root.debugAll();
}
Gdx.gl.glEnable(GL20.GL_BLEND);
debugShapes.setProjectionMatrix(viewport.getCamera().combined);
debugShapes.begin();
root.drawDebug(debugShapes);
debugShapes.end();
}
Aggregations