Created
February 14, 2018 01:34
-
-
Save ickybodclay/b685b22edf5d82b76ebc9d3fdf4acd2e to your computer and use it in GitHub Desktop.
[LibGDX] Control Scene2D Buttons With A Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TextButton.TextButtonStyle buttonStyle = new TextButton.TextButtonStyle(); | |
buttonStyle.font = new BitmapFont(); | |
buttonStyle.font.scale(2f); | |
buttonStyle.fontColor = Color.WHITE; | |
buttonStyle.overFontColor = Color.LIGHT_GRAY; | |
buttonStyle.downFontColor = Color.GRAY; | |
newGameButton = new TextButton("New Game", buttonStyle); | |
continueButton = new TextButton("Continue", buttonStyle); | |
optionsButton = new TextButton("Options", buttonStyle); | |
exitButton = new TextButton("Exit", buttonStyle); | |
Table buttonGroup = new Table(); | |
buttonGroup.setFillParent(true); | |
buttonGroup.align(Align.center); | |
buttonGroup.add(newGameButton); | |
buttonGroup.row(); | |
buttonGroup.add(continueButton); | |
buttonGroup.row(); b | |
uttonGroup.add(optionsButton); | |
buttonGroup.row(); | |
buttonGroup.add(exitButton); | |
stage.addActor(buttonGroup); | |
Controllers.addListener(new MenuControllerListener(buttonWrapper)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment