Search in sources :

Example 1 with TextManagerUI

use of com.bladecoder.engine.ui.TextManagerUI 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)

Example 2 with TextManagerUI

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

the class RetroSceneScreen method setUI.

@Override
public void setUI(UI ui) {
    this.ui = ui;
    recorder = ui.getRecorder();
    testerBot = ui.getTesterBot();
    textManagerUI = new TextManagerUI(ui.getSkin());
    menuButton = new Button(ui.getSkin(), "menu");
    dialogUI = new DialogUI(ui);
    verbUI = new VerbUI(this);
    pointer = new Pointer(ui.getSkin());
}
Also used : TextManagerUI(com.bladecoder.engine.ui.TextManagerUI) Button(com.badlogic.gdx.scenes.scene2d.ui.Button) DialogUI(com.bladecoder.engine.ui.DialogUI) Pointer(com.bladecoder.engine.ui.Pointer)

Aggregations

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