List of usage examples for com.badlogic.gdx.scenes.scene2d.ui ScrollPane ScrollPane
public ScrollPane(Actor widget)
From source file:com.gdx.extension.ui.Console.java
License:Apache License
/** * Create a console with specified style. * /*from w w w .ja va2 s . com*/ * @param maxEntries the max lines to display in the console * @param style the style to use */ public Console(int maxEntries, ConsoleStyle style) { this.maxEntries = maxEntries; this.style = style; commandsHistory = new Array<String>(); commands = new ObjectMap<String, Command>(); body = new VerticalGroup(); body.left(); consoleContainer = new Container<VerticalGroup>(body); consoleContainer.setBackground(style.consoleBackground); consoleContainer.left().top(); consoleContainer.pad(10f); consoleScroll = new ScrollPane(consoleContainer); consoleScroll.setScrollingDisabled(true, false); consoleScroll.setFlickScroll(false); textfield = new TextField("", style.textfieldStyle); textfield.addCaptureListener(new InputListener() { @Override public boolean keyDown(InputEvent event, int keycode) { switch (keycode) { case Keys.ENTER: String _inputs = textfield.getText(); if (_inputs.length() > 0) { textfield.setText(""); String[] _split = _inputs.split(" "); if (_split.length == 0) { break; } if (commandsHistory.size == 0 || !(commandsHistory.peek().equals(_inputs))) { commandsHistory.add(_inputs); } currentHistory = commandsHistory.size; Command _commandAction = commands.get(_split[0]); if (_commandAction == null) { addEntry("Command " + _split[0] + " not found"); } else { String[] _args = null; if (_split.length > 1) { _args = Arrays.copyOfRange(_split, 1, _split.length); } _commandAction.executeInternal(Console.this, _args); } } break; case Keys.UP: if (currentHistory > 0) { currentHistory--; String _historyCmd = commandsHistory.get(currentHistory); textfield.setText(_historyCmd); textfield.setCursorPosition(_historyCmd.length()); } break; case Keys.DOWN: if (currentHistory < commandsHistory.size - 1) { currentHistory++; String _historyCmd = commandsHistory.get(currentHistory); textfield.setText(_historyCmd); textfield.setCursorPosition(_historyCmd.length()); } break; default: return false; } return true; } }); add(consoleScroll).expand().fill().row(); add(textfield).fillX(); }
From source file:com.github.ykrasik.jaci.cli.libgdx.output.LibGdxCliOutputBuffer.java
License:Apache License
/** * @param skin Skin to use for the lines. * Must contain a {@link LabelStyle} called 'outputEntry' that will be used to style the lines. * @param maxBufferEntries Maximum amount of lines to store. *///from w ww .j a v a2s .com public LibGdxCliOutputBuffer(Skin skin, int maxBufferEntries) { this.skin = skin; this.maxBufferEntries = maxBufferEntries; // Create a buffer to hold out text labels. this.buffer = new Table(); buffer.setName("outputBuffer"); buffer.bottom().left(); // Wrap the buffer in a scrollpane. scrollPane = new ScrollPane(buffer); scrollPane.setName("outputBufferScrollPane"); scrollPane.setScrollingDisabled(true, false); scrollPane.setupOverscroll(0, 0, 0); scrollPane.setFillParent(true); updateScroll(); // Buffer history. this.bufferEntries = new LinkedList<>(); add(scrollPane); }
From source file:com.github.ykrasik.jerminal.libgdx.impl.LibGdxTerminal.java
License:Apache License
public LibGdxTerminal(Skin skin, int maxTerminalEntries) { this.skin = Objects.requireNonNull(skin); this.maxTerminalEntries = maxTerminalEntries; // Create a buffer to hold out text labels. this.buffer = new Table(); buffer.setName("terminalBuffer"); buffer.bottom().left();//from www . j a v a 2 s . c o m buffer.debug(); // Wrap the buffer in a scrollpane. scrollPane = new ScrollPane(buffer); scrollPane.setName("terminalBufferScrollPane"); scrollPane.setScrollingDisabled(true, false); scrollPane.setupOverscroll(0, 0, 0); scrollPane.setFillParent(true); updateScroll(); // Buffer history. this.bufferEntries = new ArrayDeque<>(maxTerminalEntries); add(scrollPane); }
From source file:com.jmolina.orb.screens.Menu.java
License:Open Source License
/** * Constructor/*from ww w. ja v a 2 s .c o m*/ * * @param superManager SuperManager */ public Menu(SuperManager superManager) { super(superManager); title = new Title(getAssetManager(), ""); title.setPosition(Utils.cell(1), Utils.cell(15.5f)); table = new Table(); table.top(); table.setPosition(Utils.cell(1), 0f); ScrollPane.ScrollPaneStyle style = new ScrollPane.ScrollPaneStyle(); style.vScrollKnob = new TextureRegionDrawable( new TextureRegion(getAsset(Asset.UI_SCROLL_KNOB, Texture.class))); scrollPane = new ScrollPane(table); scrollPane.setStyle(style); scrollPane.setWidth(VIEWPORT_WIDTH); scrollPane.setHeight(Utils.cell(14)); scrollPane.setPosition(0f, 0f); addMainActor(title); addMainActor(scrollPane); }
From source file:com.jumpbuttonstudios.vikingdodge.ui.popup.HighscoresPopup.java
License:Apache License
@Override public void create() { setScreenPositions(0, 1000, 0, 0);/* w w w. ja va 2 s .c o m*/ personal = new Table(); global = new Table(); friends = new Table(); globalScores = new Table(); setFillParent(true); backButtonPos = new Vector2(background.getWidth() / 2, 75); back = new Button(Assets.skin.get("backButton", ButtonStyle.class)); notLoggedIn = new Label("LOGIN TO SEE FRIENDS HIGHSCORES", Assets.skin.get("label", LabelStyle.class)); scrollPane = new ScrollPane(globalScores); }
From source file:com.mangecailloux.pebble.constant.ConstantEditor.java
License:Apache License
/** * ConstantEditor constructor./*from ww w . ja va 2s .c o m*/ * @param _manager _manager {@link ConstantManager} to display. Cannot be null. * @param _skin {@link Skin} to use for the UI. * @param _width Initial width of the Stage. * @param _height Initial Height of the Stage. */ public ConstantEditor(ConstantManager _manager, Skin _skin, boolean _createStage) { if (_manager == null) throw new InvalidParameterException("ConstantEditor ctor : _manager must not be null"); manager = _manager; // initial directory is the root. currentDirectory = manager.getRoot(); open = false; needSave = false; debug = false; skin = _skin; disposeSkin = false; // Stage creation stage = (_createStage) ? new Stage() : null; // Pools creation buttonPool = new Array<TextButton>(false, 4); constantTablePool = new Array<ConstantTable>(false, 4); // get the button style TextButtonStyle style = null; if (skin.has("constantEditor", TextButtonStyle.class)) style = skin.get("constantEditor", TextButtonStyle.class); else style = skin.get(TextButtonStyle.class); openButton = new TextButton("Open", style); openButton.addListener(buttonClickListener); backButton = new TextButton("Back", style); backButton.addListener(buttonClickListener); backButton.setVisible(false); backButton.setTouchable(Touchable.disabled); rootButton = new TextButton("Root", style); rootButton.addListener(buttonClickListener); rootButton.setVisible(false); rootButton.setTouchable(Touchable.disabled); saveButton = new TextButton("Save", style); saveButton.addListener(buttonClickListener); saveButton.setVisible(false); saveButton.setTouchable(Touchable.disabled); mainTable = new Table(); if (stage != null) stage.addActor(mainTable); flickTable = new Table(); flickTable.top(); NinePatch patch = skin.getPatch("constantEditor-pane"); if (patch == null) patch = skin.getPatch("default-pane-noborder"); flickTable.setBackground(new NinePatchDrawable(patch)); flickScrollpane = new ScrollPane(flickTable); flickScrollpane.setupOverscroll(5, 10, 15); flickScrollpane.setScrollingDisabled(true, false); flickScrollpane.setFlingTime(0.25f); optionsTable = new Table(); refreshOptionTable(); mainTable.pad(mainTablePadding); mainTable.add(optionsTable).expand().fill(); }
From source file:com.packtpub.libgdx.bludbourne.screens.CreditScreen.java
public CreditScreen(BludBourne game) { _game = game;/*from w ww . j a v a 2 s .c o m*/ _stage = new Stage(); Gdx.input.setInputProcessor(_stage); //Get text FileHandle file = Gdx.files.internal(CREDITS_PATH); String textString = file.readString(); Label text = new Label(textString, Utility.STATUSUI_SKIN, "credits"); text.setAlignment(Align.top | Align.center); text.setWrap(true); _scrollPane = new ScrollPane(text); _scrollPane.addListener(new ClickListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { return true; } @Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) { _scrollPane.setScrollY(0); _scrollPane.updateVisualScroll(); _game.setScreen(_game.getScreenType(BludBourne.ScreenType.MainMenu)); } }); Table table = new Table(); table.center(); table.setFillParent(true); table.defaults().width(Gdx.graphics.getWidth()); table.add(_scrollPane); _stage.addActor(table); }
From source file:com.padisDefense.game.Credit.java
License:Creative Commons License
@Override public void show() { stage = new Stage(); /* Array<CreditAnimation> animations = new Array<CreditAnimation>(); //from w w w .ja v a 2 s .com animations.add(new CreditAnimation("enemies/bipedalDragon_all.png",6,4));///// animations.add(new CreditAnimation("enemies/blue_walk_updated.png",4,4)); animations.add(new CreditAnimation("enemies/spider02.png",10,5)); animations.add(new CreditAnimation("enemies/spider03.png",10,5)); animations.add(new CreditAnimation("enemies/spider05.png",10,5)); animations.add(new CreditAnimation("enemies/king_cobra.png",3 ,4)); animations.add(new CreditAnimation("enemies/golem-walk.png",7,4)); animations.add(new CreditAnimation("enemies/mage.png", 8,2)); animations.add(new CreditAnimation("animation/fire_02.png", 8,8)); animations.add(new CreditAnimation("animation/particlefx_06.png", 8,8)); animations.add(new CreditAnimation("animation/particlefx_07.png", 8,8)); Table table = new Table(); for(int x = 0; x < animations.size; x++){ table.add(new CreditAnimation("animation/particlefx_07.png", 8,8)); table.add(new Image(new Texture("duck.png"))).pad(20f).row(); } final ScrollPane scrollPane = new ScrollPane(table); final Table scrollWrap = new Table(); scrollWrap.setFillParent(true); scrollWrap.add(scrollPane); stage = new Stage(); stage.addActor(scrollWrap); */ Label label0 = new Label("Most of the art is open-sourced. I found them on opengameart.org. \n" + "I didn't even do the credits. opengameart.org generated it for me.\n" + "The framework used for development is LibGDX.\n" + "------------------------------------------------", padi.assets.someUIskin); Label label1 = new Label( "Title:\n" + " Animated particle effects #2\n" + "\n" + "Author:\n" + " para\n" + "\n" + "URL:\n" + " http://opengameart.org/content/animated-particle-effects-2\n" + "\n" + "License(s):\n" + " * CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )\n" + "\n" + "File(s):\n" + " * para_CC0_particlefx-2.zip\n" + " * air_bubbles_01.png\n" + " * air_bubbles_02.png\n" + " * blood_hit_01.png\n" + " * blood_hit_02.png\n" + " * blood_hit_03.png\n" + " * blood_hit_04.png\n" + " * blood_hit_05.png\n" + " * blood_hit_06.png\n" + " * blood_hit_07.png\n" + " * blood_hit_08.png\n" + " * fire_01.png\n" + " * fire_01b.png\n" + " * fire_01c.png\n" + " * fire_02.png\n" + " * lighter_flame_01.png\n" + " * teleporter_01.png\n" + " * teleporter_hit.png\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label2 = new Label("\n" + "Title:\n" + " Animated particle effects #1\n" + "\n" + "Author:\n" + " para\n" + "\n" + "URL:\n" + " http://opengameart.org/content/animated-particle-effects-1\n" + "\n" + "License(s):\n" + " * CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )\n" + "\n" + "File(s):\n" + " * para_CC0_particlefx-1.zip\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label3 = new Label("\n" + "Title:\n" + " [LPC] Spider\n" + "\n" + "Author:\n" + " William.Thompsonj\n" + "\n" + "Collaborators:\n" + " Redshrike\n" + "\n" + "URL:\n" + " http://opengameart.org/content/lpc-spider\n" + "\n" + "License(s):\n" + " * CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + " * GPL 3.0 ( http://www.gnu.org/licenses/gpl-3.0.html )\n" + " * GPL 2.0 ( http://www.gnu.org/licenses/old-licenses/gpl-2.0.html )\n" + " * OGA-BY 3.0 ( http://static.opengameart.org/OGA-BY-3.0.txt )\n" + "\n" + "SPECIAL ATTRIBUTION INSTRUCTIONS:\n" + " Attribute Stephen \"Redshrike\" Challener as graphic artist and William.Thompsonj as contributor. If reasonable link to this page or the OGA homepage.\n" + "\n" + "File(s):\n" + " * LPC_Spiders.zip\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label4 = new Label("\n" + "Title:\n" + " [LPC] Imp\n" + "\n" + "Author:\n" + " William.Thompsonj\n" + "\n" + "Collaborators:\n" + " Redshrike\n" + "\n" + "URL:\n" + " http://opengameart.org/content/lpc-imp\n" + "\n" + "License(s):\n" + " * CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + " * GPL 3.0 ( http://www.gnu.org/licenses/gpl-3.0.html )\n" + " * GPL 2.0 ( http://www.gnu.org/licenses/old-licenses/gpl-2.0.html )\n" + " * OGA-BY 3.0 ( http://static.opengameart.org/OGA-BY-3.0.txt )\n" + "\n" + "SPECIAL ATTRIBUTION INSTRUCTIONS:\n" + " Link my profile (if reasonable), credit Redshrike as graphic artist, and credit me as contributor (I did pay to have it made after all...)\n" + "\n" + "File(s):\n" + " * LPC_imp.zip\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label5 = new Label("Title:\n" + " Biped Dragon Sprite Sheet\n" + "\n" + "Author:\n" + " Marco Giorgini\n" + "\n" + "URL:\n" + " http://opengameart.org/content/biped-dragon-sprite-sheet\n" + "\n" + "License(s):\n" + " * CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + "\n" + "File(s):\n" + " * Biped.Dragon.zip\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label6 = new Label("Title:\n" + " [LPC] Golem\n" + "\n" + "Author:\n" + " William.Thompsonj\n" + "\n" + "Collaborators:\n" + " Redshrike\n" + "\n" + "URL:\n" + " http://opengameart.org/content/lpc-golem\n" + "\n" + "License(s):\n" + " * CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + " * GPL 3.0 ( http://www.gnu.org/licenses/gpl-3.0.html )\n" + " * GPL 2.0 ( http://www.gnu.org/licenses/old-licenses/gpl-2.0.html )\n" + " * OGA-BY 3.0 ( http://static.opengameart.org/OGA-BY-3.0.txt )\n" + "\n" + "Copyright/Attribution Notice:\n" + " Attribute Stephen \"Redshrike\" Challener as graphic artist and William.Thompsonj as contributor. If reasonable link to this page or the OGA homepage.\n" + "\n" + "File(s):\n" + " * golem-walk.png\n" + " * golem-atk.png\n" + " * golem-die.png\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label7 = new Label("Title:\n" + " King Cobra\n" + "\n" + "Author:\n" + " AntumDeluge\n" + "\n" + "URL:\n" + " http://opengameart.org/content/king-cobra\n" + "\n" + "License(s):\n" + " * CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + "\n" + "SPECIAL ATTRIBUTION INSTRUCTIONS:\n" + " Should be attributed to Jordan Irwin.\n" + "\n" + "File(s):\n" + " * king_cobra_0.1.zip\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label8 = new Label("Title:\n" + " Fire Spell Explosion\n" + "\n" + "Author:\n" + " Clint Bellanger\n" + "\n" + "URL:\n" + " http://opengameart.org/content/fire-spell-explosion\n" + "\n" + "License(s):\n" + " * CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + "\n" + "File(s):\n" + " * explosion.png\n" + " * explosion.blend_.zip\n" + "\n" + "----------------------------------------\n", padi.assets.someUIskin); Label label9 = new Label( "Title:\n" + " 16x16 Mage\n" + "\n" + "Author:\n" + " saint11\n" + "\n" + "URL:\n" + " http://opengameart.org/content/16x16-mage\n" + "\n" + "License(s):\n" + " * CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )\n" + "\n" + "File(s):\n" + " * mage.png\n" + "\n" + "----------------------------------------", padi.assets.someUIskin); Label label10 = new Label("Title:\n" + "\tItem Collection - Fantasy Themed\n" + "\t\n" + "Author:\n" + "\tJana Ochse, 2D-Retroperspectives, www.2d-retroperspectives.org\n" + "\t\n" + "URL:\n" + "\thttp://opengameart.org/content/item-collection-fantasy-themed\n" + "\t\n" + "License(s):\n" + "\t* CC-BY 3.0 ( http://creativecommons.org/licenses/by/3.0/legalcode )\n" + "\t\n" + "File(s):\n" + "\t2DRP_CCArt_FantasyItems.tar.gz\n" + "\t\n" + "----------------------------------------", padi.assets.someUIskin); Label label11 = new Label("\n" + "Title:\n" + "\tFREE UI ASSET PACK 1\n" + "\t\n" + "Author:\n" + "\tCTatz\n" + "\n" + "URL:\n" + "\thttp://opengameart.org/content/free-ui-asset-pack-1\n" + "\n" + "License(s):\n" + "\t* CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )\n" + "\t\n" + "File(s):\n" + "\tFREEUIASSETPACK_BY@CAMTATZ.zip\n" + "\t\n" + "Twitter:\n" + "\t@CamTatz\n" + "\t\n" + "----------------------------------------", padi.assets.someUIskin); Label label12 = new Label("\n" + "Title:\n" + "\tOpen Bundle\n" + "\t\n" + "URL:\n" + "\thttp://open.commonly.cc/\n" + "\t\n" + "License(s):\n" + "\t* CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )\n" + "\t\n" + "----------------------------------------", padi.assets.someUIskin); Table s = new Table(); s.add(label0).row(); s.add(label1).row(); s.add(label2).row(); s.add(label3).row(); s.add(label4).row(); s.add(label5).row(); s.add(label6).row(); s.add(label7).row(); s.add(label8).row(); s.add(label9).row(); s.add(label10).row(); s.add(label11).row(); s.add(label12).row(); final ScrollPane scroll = new ScrollPane(s); final Table scrollWrapper = new Table(); scrollWrapper.setFillParent(true); scrollWrapper.add(scroll); TextButton menu = new TextButton("Menu", padi.assets.bubbleUI, "yellow"); menu.setSize(150f, 60f); menu.setPosition(Gdx.graphics.getWidth() - menu.getWidth() - 20f, 20f); menu.addListener(new ClickListener() { @Override public void clicked(InputEvent e, float x, float y) { padi.setScreen(padi.main_menu); } }); stage.addActor(scrollWrapper); stage.addActor(menu); Gdx.input.setInputProcessor(stage); }
From source file:com.remnants.game.screens.CreditScreen.java
public CreditScreen(Remnants game) { _game = game;/*from w ww . j a v a2 s .c om*/ _stage = new Stage(); Gdx.input.setInputProcessor(_stage); //Get text FileHandle file = Gdx.files.internal(CREDITS_PATH); String textString = file.readString(); Label text = new Label(textString, Utility.STATUSUI_SKIN, "credits"); text.setAlignment(Align.top | Align.center); text.setWrap(true); text.setFontScale(6); _scrollPane = new ScrollPane(text); _scrollPane.addListener(new ClickListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { return true; } @Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) { _scrollPane.setScrollY(0); _scrollPane.updateVisualScroll(); _game.setScreen(_game.getScreenType(Remnants.ScreenType.MainMenu)); } }); Table table = new Table(); table.center(); table.setFillParent(true); table.defaults().width(Gdx.graphics.getWidth()); table.add(_scrollPane); _stage.addActor(table); }
From source file:com.roterballon.balloonburster.scenes.AboutHUD.java
License:Common Public License
public AboutHUD(com.roterballon.balloonburster.BalloonBursterGame game) { this.game = game; this.assetmanager = game.getAssetManager(); this.skin = new Skin(Gdx.files.internal("skin/uiskin.json")); this.viewport = new FitViewport(com.roterballon.balloonburster.BalloonBursterGame.V_WIDTH, com.roterballon.balloonburster.BalloonBursterGame.V_HEIGHT, new OrthographicCamera()); this.stage = new Stage(this.viewport, game.getSpriteBatch()); // create wrapper table Table wrapper = new Table(); wrapper.top();//from w ww . j a v a 2 s . c o m wrapper.setWidth(com.roterballon.balloonburster.BalloonBursterGame.V_WIDTH * 0.8f); wrapper.setHeight(com.roterballon.balloonburster.BalloonBursterGame.V_HEIGHT * 0.65f); Label aboutLabel = new Label("About", skin, "logo"); wrapper.add(aboutLabel).expandX().align(Align.left); wrapper.row(); // create scroll wrapper table Table scrollWrapper = new Table(); //scrollWrapper.debug(); scrollWrapper.top(); // create content for scrollWrapper Label graphicsLabel = new Label("Graphics", skin, "bold"); scrollWrapper.add(graphicsLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); //cloud 1 attribution Label cloud1LinkLabel = new Label("Clouds", skin, "link"); cloud1LinkLabel.setAlignment(Align.center); cloud1LinkLabel.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Gdx.net.openURI("https://www.flickr.com/photos/craightonmiller/5944377614/"); } }); scrollWrapper.add(cloud1LinkLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); String cloud1Text = "by Craighton Miller is licensed under CC BY 2.0"; Label cloud1TextLabel = new Label(cloud1Text, skin); cloud1TextLabel.setWrap(true); scrollWrapper.add(cloud1TextLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); //cloud 2 attribution Label cloud2LinkLabel = new Label("Single white cloud on a clear blue sky", skin, "link"); cloud2LinkLabel.setWrap(true); cloud2LinkLabel.setAlignment(Align.center); cloud2LinkLabel.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Gdx.net.openURI("https://www.flickr.com/photos/horiavarlan/4777129318"); } }); scrollWrapper.add(cloud2LinkLabel).width(wrapper.getWidth() * 0.9f).padTop(30); scrollWrapper.row(); String cloud2Text = "by Horia Varlan is licensed under CC BY 2.0"; Label cloud2TextLabel = new Label(cloud2Text, skin); cloud2TextLabel.setWrap(true); scrollWrapper.add(cloud2TextLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); //balloons attribution Label balloonsTextLabel = new Label("Balloons created by", skin); balloonsTextLabel.setWrap(true); balloonsTextLabel.setAlignment(Align.center); scrollWrapper.add(balloonsTextLabel).width(wrapper.getWidth() * 0.9f).padTop(30); scrollWrapper.row(); Label balloonsLinkLabel = new Label("Marius Nolden", skin, "link"); balloonsLinkLabel.setAlignment(Align.center); balloonsLinkLabel.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Gdx.net.openURI("https://www.youtube.com/user/HydriasLP"); } }); scrollWrapper.add(balloonsLinkLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); //sound attribution Label soundLabel = new Label("Sound", skin, "bold"); scrollWrapper.add(soundLabel).width(wrapper.getWidth() * 0.9f).padTop(30); scrollWrapper.row(); //music attribution Label musicLinkLabel = new Label("Flight", skin, "link"); musicLinkLabel.setAlignment(Align.center); musicLinkLabel.addListener(new ClickListener() { public void clicked(InputEvent e, float x, float y) { Gdx.net.openURI("https://soundcloud.com/iamhydra/flight"); } }); scrollWrapper.add(musicLinkLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); String musicText = "by Hydra and LucienMusique is used as background music."; Label musicTextLabel = new Label(musicText, skin); musicTextLabel.setWrap(true); scrollWrapper.add(musicTextLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); //balloon pop attribution Label balloonPopLinkLabel = new Label("Balloon Pop", skin, "link"); balloonPopLinkLabel.setAlignment(Align.center); balloonPopLinkLabel.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Gdx.net.openURI("http://www.freesound.org/people/qubodup/sounds/222373/"); } }); scrollWrapper.add(balloonPopLinkLabel).width(wrapper.getWidth() * 0.9f).padTop(30); scrollWrapper.row(); String balloonPopText = "by qubodup is licensed under CC BY 3.0"; Label balloonPopTextLabel = new Label(balloonPopText, skin); balloonPopTextLabel.setWrap(true); scrollWrapper.add(balloonPopTextLabel).width(wrapper.getWidth() * 0.9f); scrollWrapper.row(); String dev = "A game developed by roterballon.com"; Label devLabel = new Label(dev, skin, "bold-outline"); devLabel.setWrap(true); devLabel.setAlignment(Align.center); scrollWrapper.add(devLabel).width(wrapper.getWidth() * 0.9f).padTop(30); scrollWrapper.pack(); // create scroll pane ScrollPane scrollContainer = new ScrollPane(scrollWrapper); scrollContainer.setOverscroll(false, true); wrapper.add(scrollContainer).expandX().align(Align.left); // set Background wrapper.setBackground(new NinePatchDrawable( new NinePatch(assetmanager.get("img/bg_ninepatch.png", Texture.class), 10, 10, 10, 10))); wrapper.pack(); wrapper.setWidth(com.roterballon.balloonburster.BalloonBursterGame.V_WIDTH * 0.8f); wrapper.setHeight(com.roterballon.balloonburster.BalloonBursterGame.V_HEIGHT * 0.65f); wrapper.setPosition(com.roterballon.balloonburster.BalloonBursterGame.V_WIDTH / 2, com.roterballon.balloonburster.BalloonBursterGame.V_HEIGHT - wrapper.getHeight() / 2 - 220, Align.center); // padTop of 220 ImageButton menu = new ImageButton( new TextureRegionDrawable( assetmanager.get("img/buttons/buttons.atlas", TextureAtlas.class).findRegion("btn_menu")), new TextureRegionDrawable(assetmanager.get("img/buttons/buttons.atlas", TextureAtlas.class) .findRegion("btn_menu_pressed"))); menu.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { AboutHUD.this.game.transition(new MenuScreen(AboutHUD.this.game)); } }); menu.setSize(400, 70); menu.setPosition(com.roterballon.balloonburster.BalloonBursterGame.V_WIDTH / 2, wrapper.getY() - 50, Align.top | Align.center); stage.addActor(wrapper); stage.addActor(menu); Gdx.input.setInputProcessor(stage); }