Search in sources :

Example 1 with InventoryUI

use of com.bladecoder.engine.ui.InventoryUI in project bladecoder-adventure-engine by bladecoder.

the class DefaultSceneScreen method setUI.

@Override
public void setUI(final UI ui) {
    this.ui = ui;
    recorder = ui.getRecorder();
    testerBot = ui.getTesterBot();
    pie = new PieMenu(this);
    textManagerUI = new TextManagerUI(ui.getSkin());
    menuButton = new Button(ui.getSkin(), "menu");
    dialogUI = new DialogUI(ui);
    pointer = new ScenePointer(ui.getSkin());
    inventoryUI = new InventoryUI(this, pointer);
    inventoryButton = new InventoryButton(ui.getSkin(), inventoryUI);
    uiMode = UIModes.valueOf(Config.getProperty(Config.UI_MODE, "TWO_BUTTONS").toUpperCase(Locale.ENGLISH));
    if (Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen) && uiMode == UIModes.TWO_BUTTONS) {
        uiMode = UIModes.PIE;
    }
    pie.setVisible(false);
    menuButton.addListener(new ClickListener() {

        public void clicked(InputEvent event, float x, float y) {
            ui.setCurrentScreen(Screens.MENU_SCREEN);
        }
    });
    retrieveAssets(ui.getUIAtlas());
    stage = new Stage(viewport);
    stage.addActor(textManagerUI);
    stage.addActor(dialogUI);
    stage.addActor(inventoryButton);
    stage.addActor(menuButton);
    stage.addActor(inventoryUI);
    stage.addActor(pie);
}
Also used : TextManagerUI(com.bladecoder.engine.ui.TextManagerUI) Button(com.badlogic.gdx.scenes.scene2d.ui.Button) InventoryButton(com.bladecoder.engine.ui.InventoryButton) DialogUI(com.bladecoder.engine.ui.DialogUI) PieMenu(com.bladecoder.engine.ui.PieMenu) InventoryUI(com.bladecoder.engine.ui.InventoryUI) Stage(com.badlogic.gdx.scenes.scene2d.Stage) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) InventoryButton(com.bladecoder.engine.ui.InventoryButton) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 Stage (com.badlogic.gdx.scenes.scene2d.Stage)1 Button (com.badlogic.gdx.scenes.scene2d.ui.Button)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 DialogUI (com.bladecoder.engine.ui.DialogUI)1 InventoryButton (com.bladecoder.engine.ui.InventoryButton)1 InventoryUI (com.bladecoder.engine.ui.InventoryUI)1 PieMenu (com.bladecoder.engine.ui.PieMenu)1 TextManagerUI (com.bladecoder.engine.ui.TextManagerUI)1