List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Table padTop
Value padTop
To view the source code for com.badlogic.gdx.scenes.scene2d.ui Table padTop.
Click Source Link
From source file:com.exovum.test.animation.AnimatorMenuScreen.java
License:Creative Commons License
public AnimatorMenuScreen(final Game game) { this.batch = new SpriteBatch(); this.game = game; screen = this; menuBackground = new Texture(Gdx.files.internal("beach-ocean-sea-bg/transparent-png/full_background.png")); menuMusic = Gdx.audio.newMusic(Gdx.files.internal("Carpe Diem.mp3")); stage = new Stage(new FitViewport(800, 480)); Gdx.input.setInputProcessor(stage);/*from w w w . j a v a2 s .c o m*/ // Setup the UI skin. Pass the TextureAtlas too so it can find the default settings. TextureAtlas skinAtlas = new TextureAtlas(Gdx.files.internal("uiskin.atlas")); skin = new Skin(Gdx.files.internal("uiskin.json"), skinAtlas); mainTable = new Table(skin); //mainTable.defaults().expand().fill().padBottom(4f).padTop(4f); mainTable.setFillParent(true); // Add the title of the game at the top of the MenuScreen titleTable = new Table(skin); final Label titleLabel = new Label("Kordan Jirby", skin, "title"); titleLabel.setColor(Color.FIREBRICK); //titleLabel.setStyle(new Label.LabelStyle(titleFont, Color.FIREBRICK)); titleLabel.setAlignment(Align.center, Align.center); titleLabel.setPosition(stage.getWidth() / 2, stage.getHeight()); //titleLabel.setFontScale(2.0f); titleTable.defaults().expand().fill().padBottom(4f).padTop(4f); titleTable.add(titleLabel); titleTable.padBottom(10f); // Bottom/Base Table: left-child holds buttonTable for menu buttons, // right-child holds some text info ie instructions or credits baseTable = new Table(skin); baseTable.defaults().expand().fill().padBottom(10f).padTop(10f); // Add the buttons for the user to press: play, help, credits, exit TextButton playButton = new TextButton("Play Game", skin, "small-font"); TextButton helpButton = new TextButton("Instructions", skin, "small-font"); TextButton creditsButton = new TextButton("Credits", skin, "small-font"); TextButton exitButton = new TextButton("Exit", skin, "small-font"); Table buttonTable = new Table(skin); // Add the button table as the left-child to baseTable baseTable.add(buttonTable); //menuTable.setBackground("console2"); // Set the color of the BACKGROUND on the buttons Color buttonColor = Color.SKY; Gdx.app.log("AnimatorMenuScreen", "Color RGB SKY: " + Color.SKY.toString()); playButton.setColor(buttonColor); helpButton.setColor(buttonColor); creditsButton.setColor(buttonColor); exitButton.setColor(buttonColor); // Set the color of the TEXT on the buttons //buttonColor = new Color(0.845f, 0.845f, 0.845f, 1); buttonColor = new Color(0.91f, 0.91f, 0.91f, 1); playButton.getLabel().setColor(buttonColor); helpButton.getLabel().setColor(buttonColor); creditsButton.getLabel().setColor(buttonColor); exitButton.getLabel().setColor(buttonColor); buttonTable.defaults().expand().fill().padBottom(8f).padTop(2f); buttonTable.add(playButton).width(180f).height(60f).row(); buttonTable.add(helpButton).width(180f).height(60f).row(); buttonTable.add(creditsButton).width(180f).height(60f).row(); buttonTable.add(exitButton).width(180f).height(60f); buttonTable.padTop(30f).padBottom(30f); buttonTable.left(); /* Temporary removal of infoTable It was not easy for me to add hidden/new text and for the layouts to update correctly. Changing plan to create a new Screen for Credits (and instructions too). */ infoTable = new Table(skin); // = new Label("", skin, "small-font"); infoTable.setVisible(false); infoTable.defaults().expand().fill().padBottom(8f).padTop(2f); //baseTable.add(infoTable); // Add title table at the top of mainTable mainTable.add(titleTable).row(); // Add baseTable containing buttonTable to the next row of mainTable //mainTable.add(buttonTable); mainTable.add(baseTable); // Add mainTable to the stage stage.addActor(mainTable); // Event Listeners for the menu buttons playButton.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { Gdx.app.log("AnimatorMenuScreen", "Pressed playButton"); //game.setScreen(new AnimatorGameScreen(game, screen)); ((Game) Gdx.app.getApplicationListener()).setScreen(new AnimatorGameScreen(game, screen)); } }); helpButton.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { Gdx.app.log("AnimatorMenuScreen", "Pressed helpButton"); //game.setScreen(new InstructionsScreen(game, screen)); ((Game) Gdx.app.getApplicationListener()).setScreen(new InstructionsScreen(game, screen)); } }); creditsButton.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { Gdx.app.log("AnimatorMenuScreen", "Pressed creditsButton"); //game.setScreen(new CreditsScreen(game, screen)); ((Game) Gdx.app.getApplicationListener()).setScreen(new CreditsScreen(game, screen)); /* * Attempt at adding text next to the buttons. * Status: Unsuccessful. Updating the layout once adding the credits text * does not update as easily as I hoped. * Changing plan to use different Screens for Credits & Instructions. // If the table is visible and already showing credits, then 'minimize' infoTable if(infoTable.isVisible() && infoTable.getName() != null && infoTable.getName().equals("Credits")) { Gdx.app.log("AnimatorMenuScreen", "Hide the credits menu"); infoTable.setVisible(false); infoTable.clearChildren(); } else { Gdx.app.log("AnimatorMenuScreen", "Display the credits text"); // Otherwise, make the infoTable visible and set text to the credits infoTable.setVisible(true); infoTable.clearChildren(); //infoTable.center(); Label musicLabel = new Label("Music\n" + "Pixel Peeker Polka - slower Kevin MacLeod (incompetech.com)\n" + "Licensed under Creative Commons: By Attribution 3.0 License\n" + "http://creativecommons.org/licenses/by/3.0/", skin, "small-font"); musicLabel.setColor(Color.BLACK); //infoTable.addActor(musicLabel); infoTable.addActor(musicLabel); infoTable.padLeft(20f); //musicLabel.setPosition(stage.getWidth() / 2 + 50, stage.getHeight() / 2 + 100, Align.right); infoTable.defaults().expand().fill().padBottom(8f).padTop(2f); musicLabel.setWidth(200f); //musicLabel.setWrap(true); musicLabel.setAlignment(Align.center); //musicLabel.setFillParent(true); // "Invalidates this actor's layout, causing layout() to happen next time // validate() is called infoTable.invalidate(); baseTable.invalidate(); infoTable.center(); //infoTable.setFillParent(true); //titleTable.add(musicLabel); } infoTable.setName("Credits"); */ } }); exitButton.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { Gdx.app.log("AnimatorMenuScreen", "Pressed exitButton - exiting application"); Gdx.app.exit(); } }); }
From source file:com.mbrlabs.mundus.ui.modules.dialogs.AddTerrainDialog.java
License:Apache License
private void setupUI() { Table root = new Table(); // root.debugAll(); root.padTop(6).padRight(6).padBottom(22); add(root);/*from w ww . ja v a2 s . co m*/ // left table VisTable content = new VisTable(); content.left().top(); content.add(new VisLabel("Name: ")).left().padBottom(10); content.add(name).fillX().expandX().row(); content.add(new VisLabel("Vertex resolution: ")).left().padBottom(10); content.add(vertexResolution).fillX().expandX().row(); content.add(new VisLabel("Position on x-axis:")).left().padBottom(10); content.add(positionX).fillX().expandX().row(); content.add(new VisLabel("Position on z-axis: ")).left().padBottom(10); content.add(positionZ).fillX().expandX().row(); content.add(new VisLabel("Terrain width: ")).left().padBottom(10); content.add(terrainWidth).fillX().expandX().row(); content.add(new VisLabel("Terrain depth")).left().padBottom(10); content.add(terrainDepth).fillX().expandX().row(); content.add(generateBtn).fillX().expand().colspan(2).bottom(); root.add(content).width(500).height(400); }
From source file:com.mbrlabs.mundus.ui.modules.dialogs.AmbientLightDialog.java
License:Apache License
private void setupUI() { Table root = new Table(); root.padTop(6).padRight(6).padBottom(22); add(root);//from w ww. j a v a 2s . co m root.add(new VisLabel("Intensity: ")).left().padBottom(10); root.add(intensity).fillX().expandX().padBottom(10).row(); root.add(colorPickerField).left().fillX().expandX().colspan(2).row(); resetValues(); }
From source file:com.mbrlabs.mundus.ui.modules.dialogs.ExportDialog.java
License:Apache License
private void setupUI() { gzipCheckbox.left();/*from w w w .j av a 2 s.co m*/ prettyPrintCheckbox.left(); Table root = new Table(); // root.debugAll(); root.padTop(6).padRight(6).padBottom(22); add(root).left().top(); root.add(output).width(320).padRight(7).padBottom(5).left(); root.add(fileChooserBtn).width(80).left().padBottom(5).row(); root.add(gzipCheckbox).width(400).colspan(2).row(); root.add(prettyPrintCheckbox).width(400).colspan(2).row(); root.add(exportBtn).width(400).padTop(15).colspan(2).row(); fileChooser = new FileChooser(FileChooser.Mode.OPEN); fileChooser.setSelectionMode(FileChooser.SelectionMode.DIRECTORIES); }
From source file:com.mbrlabs.mundus.ui.modules.dialogs.FogDialog.java
License:Apache License
private void setupUI() { Table root = new Table(); // root.debugAll(); root.padTop(6).padRight(6).padBottom(22); add(root);//from w w w. ja v a 2s . co m root.add(useFog).left().padBottom(10).colspan(2).row(); root.add(new VisLabel("Density: ")).left().padBottom(10); root.add(density).fillX().expandX().padBottom(10).row(); root.add(new VisLabel("Gradient: ")).left().padBottom(10); root.add(gradient).fillX().expandX().padBottom(10).row(); root.add(colorPickerField).left().fillX().expandX().colspan(2).row(); resetValues(); }
From source file:com.torrosoft.triviazo.screens.PreferencesScreen.java
License:Open Source License
@Override public void show() { super.show(); final Table table = super.getTable(); final Texture img = new Texture(Gdx.files.internal("images/preferencias.png")); final Drawable drawable = new TextureRegionDrawable(new TextureRegion(img)); table.setBackground(drawable);/*w w w . j a v a2 s . c o m*/ table.defaults().spaceBottom(30F); table.columnDefaults(0).padRight(20F); final Texture chCheckedTex = new Texture(Gdx.files.internal("images/buttons/chChecked.png")); final Texture chUncheckedTex = new Texture(Gdx.files.internal("images/buttons/chUnchecked.png")); final Drawable chCheckedDraw = new TextureRegionDrawable(new TextureRegion(chCheckedTex)); final Drawable chUncheckedDraw = new TextureRegionDrawable(new TextureRegion(chUncheckedTex)); final ImageButton.ImageButtonStyle checkStyle = new ImageButton.ImageButtonStyle(chUncheckedDraw, chCheckedDraw, chCheckedDraw, chUncheckedDraw, chCheckedDraw, chCheckedDraw); final ImageButton chSoundEffects = new ImageButton(checkStyle); chSoundEffects.setChecked(game.getPreferencesManager().isSoundEnabled()); chSoundEffects.addListener(new ChangeListener() { @Override public void changed(final ChangeEvent event, final Actor actor) { final boolean enabled = chSoundEffects.isChecked(); game.getPreferencesManager().setSoundEnabled(enabled); game.getSoundManager().setEnabled(enabled); game.getSoundManager().play(TriviazoSound.CLICK); } }); table.row(); table.add("Efectos de sonido"); table.add(chSoundEffects).colspan(2).left(); final ImageButton chMusic = new ImageButton(checkStyle); chMusic.setChecked(game.getPreferencesManager().isMusicEnabled()); chMusic.addListener(new ChangeListener() { @Override public void changed(final ChangeEvent event, final Actor actor) { final boolean enabled = chMusic.isChecked(); game.getPreferencesManager().setMusicEnabled(enabled); game.getMusicManager().setEnabled(enabled); game.getSoundManager().play(TriviazoSound.CLICK); // if the music is now enabled, start playing the menu music game.getMusicManager().play(TriviazoMusic.MAIN); } }); table.row(); table.add("Msica"); table.add(chMusic).colspan(2).left(); // range is [0.0,1.0]; step is 0.1f // TODO bigger slider final Slider volumeSlider = new Slider(0f, 1f, 0.1f, false, getSkin()); volumeSlider.setValue(game.getPreferencesManager().getVolume()); volumeSlider.addListener(new ChangeListener() { @Override public void changed(final ChangeEvent event, final Actor actor) { final float value = ((Slider) actor).getValue(); game.getPreferencesManager().setVolume(value); game.getMusicManager().setVolume(value); game.getSoundManager().setVolume(value); updateVolumeLabel(); } }); // create the volume label volumeValue = new Label("", getSkin()); updateVolumeLabel(); // add the volume row table.row(); table.add("Volumen"); table.add(volumeSlider); table.add(volumeValue).width(40); // register the back button final TextButton backButton = new TextButton("Volver al men", getSkin()); backButton.addListener(new InputListener() { @Override public void touchUp(final InputEvent event, final float x, final float y, final int pointer, final int button) { super.touchUp(event, x, y, pointer, button); game.getSoundManager().play(TriviazoSound.CLICK); game.setScreen(new MenuScreen(game)); } @Override public boolean touchDown(final InputEvent event, final float x, final float y, final int pointer, final int button) { return true; } }); table.row(); table.add(" "); table.row(); table.add(backButton).size(250, 60).colspan(3); table.padTop(100F); }
From source file:com.tumblr.oddlydrawn.nahlc.screens.LicenseScreen.java
License:Apache License
public LicenseScreen(Game g) { game = g;//from w w w .j a va2s. com stage = new Stage(new FitViewport(WIDTH, HEIGHT)); skin = new Skin(); assets = new Assets(); assets.initMainMenu(); Gdx.input.setInputProcessor(stage); FileHandle handle; handle = Gdx.files.internal(LICENSE_PATH); licenseString = handle.readString(); Table table = new Table(); table.setFillParent(true); stage.addActor(table); skin.add("default", new BitmapFont(Gdx.files.internal(FONT_PATH))); LabelStyle labelStyle = new LabelStyle(); labelStyle.font = skin.getFont("default"); skin.add("default", labelStyle); ScrollPaneStyle scrollPaneStyle = new ScrollPaneStyle(); skin.add("default", scrollPaneStyle); TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.font = skin.getFont("default"); textButtonStyle.up = new NinePatchDrawable(assets.getBoxPatch()); skin.add("default", textButtonStyle); Label license = new Label(licenseString, skin); ScrollPane scrollPane = new ScrollPane(license, skin); scrollPane.setFlickScroll(true); table.add(scrollPane); table.row(); TextButton backButton = new TextButton("Back", skin); table.add(backButton).padTop(TABLE_PAD); table.padTop(TABLE_PAD); table.padBottom(TABLE_PAD); table.row(); backButton.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { dispose(); game.setScreen(new MainMenuScreen(game)); } }); }
From source file:com.tumblr.oddlydrawn.stupidworm.screens.LicenseScreen.java
License:Apache License
public LicenseScreen(Game g) { game = g;//w w w . j a v a 2 s . co m stage = new Stage(); skin = new Skin(); batch = new SpriteBatch(); FileHandle handle; handle = Gdx.files.internal(LICENSE_LOC); licenseString = handle.readString(); atlas = new TextureAtlas(Gdx.files.internal(TEXTURE_ATLAS_LOC)); NinePatch patchBox; patchBox = new NinePatch(atlas.createPatch(PATCH_BOX_REGION_STRING)); Gdx.input.setInputProcessor(stage); stage.setViewport(new StretchViewport(WIDTH, HEIGHT)); Table table = new Table(); table.setFillParent(true); stage.addActor(table); Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(Color.LIGHT_GRAY); pixmap.fill(); // The following defines the defaults for Scene2D's skin skin.add("grey", new Texture(pixmap)); skin.add("default", new BitmapFont(Gdx.files.internal(FONT_LOC))); LabelStyle labelStyle = new LabelStyle(); labelStyle.font = skin.getFont("default"); skin.add("default", labelStyle); ScrollPaneStyle scrollPaneStyle = new ScrollPaneStyle(); skin.add("default", scrollPaneStyle); ButtonStyle buttonStyle = new ButtonStyle(); skin.add("default", buttonStyle); TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.font = skin.getFont("default"); textButtonStyle.up = new NinePatchDrawable(patchBox); skin.add("default", textButtonStyle); // Creates Actors (the entire LICENSE text file) for Scene2D Label license = new Label(licenseString, skin); ScrollPane scrollPane = new ScrollPane(license, skin); scrollPane.setFlickScroll(true); table.add(scrollPane); // Creates the padding between the text and the button. table.row(); // Label padding = new Label(LABEL_PADDING, skin); // table.add(padding); // Creates the 'Okay' button table.row(); TextButton okay = new TextButton("Okay", skin); table.add(okay); okay.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { dispose(); game.setScreen(new MainMenuScreen(game)); } }); // Adds padding on top and on the bottom of the table. table.padTop(TABLE_PADDING); table.padBottom(TABLE_PADDING); table.pack(); }
From source file:com.uwsoft.editor.gdx.ui.UIItemsBox.java
License:Apache License
public void initContent() { for (int i = 0; i < this.getChildren().size; i++) { if (this.getChildren().get(i).getName() != null && this.getChildren().get(i).getName().equals("treeTable")) { this.getChildren().get(i).remove(); break; }//w w w . j av a2 s .c om } skin = stage.textureManager.editorSkin; tree = new Tree(skin); CompositeItem sceneItems = stage.getSandbox().getCurrentScene(); Node root = addTree(sceneItems, stage.getCompositePanel().isRootScene()); for (int i = 0; i < sceneItems.getItems().size(); i++) { if (sceneItems.getItems().get(i).isComposite()) { innerComposite(sceneItems.getItems().get(i), root); } else { addTree(sceneItems.getItems().get(i), root); } } //expand root if (root != null && root.getChildren() != null && root.getChildren().size > 0 && root.getChildren().get(0) != null) { root.getChildren().get(0).expandTo(); } Table scrolltable = new Table(); scrolltable.padBottom(20); scrolltable.add(tree).fill().expand(); final ScrollPane scroller = new ScrollPane(scrolltable, skin); scroller.setFlickScroll(false); final Table table = new Table(); table.setFillParent(true); table.padTop(10); table.add(scroller).fill().expand(); table.setName("treeTable"); addActor(table); tree.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { Array<Node> selectedNodes = tree.getSelection().toArray(); for (int i = 0; i < selectedNodes.size; i++) { System.out.println(); IBaseItem baseItem = (IBaseItem) selectedNodes.get(i).getObject(); IBaseItem item = getCurrentSceneItem(stage.getSandbox().getCurrentScene(), baseItem); if (item != null) { addSelectionAction(item); } } } }); }
From source file:com.vlaaad.dice.ui.windows.CreatureInfoWindow.java
License:Open Source License
@Override protected void doShow(final Params params) { this.params = params; table.clearChildren();/*from w w w . j a v a 2s . c o m*/ Table info = new Table(Config.skin); info.setBackground(Config.skin.getDrawable("ui-creature-info-background")); Ability current = params.creature.getCurrentAbility(); LocLabel itemDescriptionLabel = new LocLabel("ui-creature-info-window-ability-description", Thesaurus.params().with("name", current.locNameKey()).with("desc", current.locDescKey()), DESCRIPTION); itemDescriptionLabel.setWrap(true); itemDescriptionLabel.setAlignment(Align.center); LocLabel effectDescriptionLabel = new LocLabel("ui-creature-info-window-no-effects", Thesaurus.params().with("name", params.creature.description.nameLocKey()), DESCRIPTION); effectDescriptionLabel.setWrap(true); effectDescriptionLabel.setAlignment(Align.center); Image itemSelection = new Image(Config.skin.getDrawable("ui-creature-info-ability-selection")); Table abilityIcons = new Table(); abilityIcons.padTop(5); boolean selected = false; int i = 0; for (Ability ability : params.creature) { AbilityIcon image = new AbilityIcon(ability); Group imageGroup = new Group(); imageGroup.setSize(image.getWidth(), image.getHeight()); imageGroup.addActor(image); abilityIcons.add(imageGroup); ClickListener listener = createListener(imageGroup, itemSelection, itemDescriptionLabel, ability, params.creature); if (!selected && i == params.creature.getCurrentAbilityIndex()) { selected = true; listener.clicked(null, 0, 0); } image.addListener(listener); if (i == 3) { abilityIcons.row(); abilityIcons.add(); } i++; } Image effectSelection = new Image(Config.skin.getDrawable("ui-creature-info-ability-selection")); Table effectsIcons = new Table(); effectsIcons.padTop(5); i = 0; boolean hasEffects = params.creature.effects.size > 0; for (CreatureEffect effect : params.creature.effects) { if (effect.isHidden()) continue; Image effectIcon = new Image(Config.skin, effect.getUiIconName()); Group imageGroup = new Group(); imageGroup.setSize(24, 24); imageGroup.addActor(effectIcon); effectIcon.setPosition(imageGroup.getWidth() / 2 - effectIcon.getWidth() / 2, imageGroup.getHeight() / 2 - effectIcon.getHeight() / 2); effectsIcons.add(imageGroup); ClickListener listener = createListener(imageGroup, effectSelection, effectDescriptionLabel, effect, params.creature); if (i == 0) { listener.clicked(null, 0, 0); } effectIcon.addListener(listener); if (i == 3) { abilityIcons.row(); } i++; } WorldObjectView view = ViewController.createView(params.world.viewer, params.world.playerColors, params.creature); view.removeSubView("name"); view.removeSubView(CreatureEffect.class); Table headerLabels = new Table(); headerLabels.align(Align.left); headerLabels.add(new LocLabel("ui-creature-info-name", Thesaurus.params().with("name", params.creature.description.nameLocKey()).with("profession", params.creature.profession.locKey()))) .expandX().fillX().row(); if (params.creature.player == params.world.viewer) { headerLabels .add(new LocLabel("ui-creature-info-ally-info", Thesaurus.params().with("level", String.valueOf(params.creature.getCurrentLevel())))) .padTop(-4).expandX().fillX().row(); } else { headerLabels.add(new LocLabel("ui-creature-info-enemy-info")).expandX().fillX().padTop(-4).row(); } Table header = new Table(Config.skin); header.align(Align.left); header.add(view).padTop(7).padRight(4).left(); header.add(headerLabels).left().row(); if (params.creature.player == params.world.viewer) { float progress = params.creature.description.profession .getLevelProgress(params.creature.getCurrentExp()); header.add(new ExpBar(progress)).width(ViewController.CELL_SIZE * 4).padLeft(3).padTop(4).left() .colspan(2).row(); } Array<Ability> professionAbilities = params.creature.profession.getAvailableAbilities(); Table pa = new Table(); pa.defaults().padTop(4); for (Ability a : professionAbilities) { ProfessionAbilityIcon icon = new ProfessionAbilityIcon(params.creature, a); pa.add(icon).row(); icon.addListener(createProfessionAbilityListener(params.creature, a)); if (!a.requirement.isSatisfied(params.creature.description)) { icon.getColor().a = 0.3f; } } Table headerTable = new Table(); headerTable.add(header); headerTable.add(pa).expandX().right().padRight(3).padTop(2); info.add(headerTable).expandX().fillX().left().row(); final TabPane tabPane = new TabPane(Config.skin); Table itemsHeader = new Table(); itemsHeader.align(Align.left); itemsHeader.add(new Image(Config.skin, "ui-creature-info-window-icon-items")).padRight(2); itemsHeader.add(new LocLabel("ui-creature-info-items")).padTop(-4).expandX().fillX().align(Align.left); Table effectsHeader = new Table(); effectsHeader.align(Align.left); effectsHeader.add(new Image(Config.skin, "ui-creature-info-window-icon-effects")).padRight(2); effectsHeader.add(new LocLabel("ui-creature-info-effects")).padTop(-4).expandX().fillX().align(Align.left); Table itemsTab = new Table(); itemsTab.add(abilityIcons).padTop(5).row(); itemsTab.add(new Image(Config.skin.getDrawable("ui-creature-info-line"))) .width(ViewController.CELL_SIZE * 4 - 16).padTop(5).row(); itemsTab.add(itemDescriptionLabel).width(ViewController.CELL_SIZE * 4 + 32).height(50).pad(5); Table effectsTab = new Table(); if (hasEffects) { effectsTab.add(effectsIcons).minHeight(48).padTop(10).row(); effectsTab.add(new Image(Config.skin.getDrawable("ui-creature-info-line"))) .width(ViewController.CELL_SIZE * 4 - 16).padTop(5).row(); } effectsTab.add(effectDescriptionLabel).width(ViewController.CELL_SIZE * 4 + 32).height(50).pad(5); tabPane.addTab(itemsHeader, itemsTab); tabPane.addTab(effectsHeader, effectsTab); info.add(tabPane).padTop(5).padBottom(-2).padLeft(-2).padRight(-2); info.setTouchable(Touchable.enabled); table.add(info); }