Search in sources :

Example 1 with ChainedStage

use of eidolons.libgdx.stage.ChainedStage in project Eidolons by IDemiurge.

the class DungeonScreen method renderMain.

public void renderMain(float delta) {
    guiStage.act(delta);
    gridStage.act(delta);
    cameraShift();
    // cam.update();
    if (canShowScreen()) {
        if (DC_Game.game != null)
            if (DC_Game.game.getGameLoop() instanceof RealTimeGameLoop) {
                // if (realTimeGameLoop != null)        realTimeGameLoop.act(delta);
                ((RealTimeGameLoop) Eidolons.game.getGameLoop()).act(delta);
            }
        if (backTexture != null) {
            if (OptionsMaster.getGraphicsOptions().getBooleanValue(GRAPHIC_OPTION.SPRITE_CACHE_ON)) {
                TextureManager.drawFromSpriteCache(TextureManager.getBackgroundId());
            } else {
                guiStage.getBatch().begin();
                float colorBits = GdxColorMaster.WHITE.toFloatBits();
                if (guiStage.getBatch().getColor().toFloatBits() != colorBits)
                    // damned alpha...
                    guiStage.getBatch().setColor(colorBits);
                guiStage.getBatch().draw(backTexture, 0, 0, GdxMaster.getWidth(), GdxMaster.getHeight());
                guiStage.getBatch().end();
            }
        }
        gridStage.setDebugAll(false);
        gridStage.draw();
        guiStage.setDebugAll(false);
        guiStage.draw();
        if (dialogsStage != null) {
            dialogsStage.setDebugAll(false);
            dialogsStage.act(delta);
            if (dialogsStage.isDone()) {
                final ChainedStage dialogsStage = this.dialogsStage;
                this.dialogsStage = null;
                dialogsStage.dispose();
                updateInputController();
            } else {
                dialogsStage.draw();
            }
        }
        if (gridPanel.getFpsLabel() != null)
            if (gridPanel != null)
                gridPanel.getFpsLabel().setText(new Float(1 / delta) + "");
        try {
            soundMaster.doPlayback(delta);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    }
}
Also used : ChainedStage(eidolons.libgdx.stage.ChainedStage) RealTimeGameLoop(eidolons.game.module.dungeoncrawl.explore.RealTimeGameLoop)

Example 2 with ChainedStage

use of eidolons.libgdx.stage.ChainedStage in project Eidolons by IDemiurge.

the class GameScreen method initDialogue.

protected void initDialogue() {
    GuiEventManager.bind(DIALOG_SHOW, obj -> {
        DialogueHandler handler = (DialogueHandler) obj.get();
        final List<DialogScenario> list = handler.getList();
        if (dialogsStage == null) {
            dialogsStage = new ChainedStage(viewPort, getBatch(), list);
            updateInputController();
        } else {
            dialogsStage.play(list);
        }
        dialogsStage.setDialogueHandler(handler);
    });
}
Also used : ChainedStage(eidolons.libgdx.stage.ChainedStage) DialogScenario(eidolons.libgdx.DialogScenario) DialogueHandler(eidolons.game.battlecraft.logic.meta.scenario.dialogue.DialogueHandler)

Example 3 with ChainedStage

use of eidolons.libgdx.stage.ChainedStage in project Eidolons by IDemiurge.

the class ScreenWithLoader method preLoad.

protected void preLoad() {
    try {
        MusicMaster.getInstance().startLoop();
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    if (data.getDialogScenarios().size() > 0) {
        introStage = new ChainedStage(viewPort, getBatch(), data.getDialogScenarios());
        introStage.setOnDoneCallback(() -> {
            if (hideLoader) {
                updateInputController();
            }
        });
    }
}
Also used : ChainedStage(eidolons.libgdx.stage.ChainedStage)

Aggregations

ChainedStage (eidolons.libgdx.stage.ChainedStage)3 DialogueHandler (eidolons.game.battlecraft.logic.meta.scenario.dialogue.DialogueHandler)1 RealTimeGameLoop (eidolons.game.module.dungeoncrawl.explore.RealTimeGameLoop)1 DialogScenario (eidolons.libgdx.DialogScenario)1