-
Notifications
You must be signed in to change notification settings - Fork 1
UI components
miguel edited this page Mar 15, 2019
·
3 revisions
This framework has a set of UI components which can be used directly in your game.
a horizontal or vertical button menu which can be controlled with mouse, controller and keyboard.
// Initialisation
ButtonMenu buttonMenu = new ButtonMenu(context.getTweenManager());
buttonMenu.add("button 1", new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
// action A
}
});
buttonMenu.add("button 2", new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
// action B
}
});
// Wiring input
context.getInputManager().register(new NavigateableKeyboardInput(buttonMenu));
context.getInputManager().register(new NavigateableControllerInput(buttonMenu));
// Adding menu to stage
context.getStage().add(buttonMenu);