Search in sources :

Example 6 with SequenceAction

use of com.badlogic.gdx.scenes.scene2d.actions.SequenceAction in project skin-composer by raeleus.

the class DialogLoading method show.

@Override
public Dialog show(Stage stage) {
    Dialog dialog = super.show(stage);
    RunnableAction runnableAction = new RunnableAction();
    runnableAction.setRunnable(() -> {
        if (runnable != null) {
            runnable.run();
        }
        hide();
    });
    Action action = new SequenceAction(new DelayAction(.5f), runnableAction);
    addAction(action);
    return dialog;
}
Also used : RunnableAction(com.badlogic.gdx.scenes.scene2d.actions.RunnableAction) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction) Action(com.badlogic.gdx.scenes.scene2d.Action) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) Dialog(com.badlogic.gdx.scenes.scene2d.ui.Dialog) RunnableAction(com.badlogic.gdx.scenes.scene2d.actions.RunnableAction) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)

Example 7 with SequenceAction

use of com.badlogic.gdx.scenes.scene2d.actions.SequenceAction in project skin-composer by raeleus.

the class MenuList method hide.

public void hide() {
    // fade out and then remove
    clearActions();
    AlphaAction alphaAction = new AlphaAction();
    alphaAction.setAlpha(0.0f);
    alphaAction.setDuration(.3f);
    alphaAction.setInterpolation(Interpolation.fade);
    RemoveActorAction removeAction = new RemoveActorAction();
    removeAction.setActor(this);
    SequenceAction sequenceAction = new SequenceAction(alphaAction, removeAction);
    addAction(sequenceAction);
}
Also used : RemoveActorAction(com.badlogic.gdx.scenes.scene2d.actions.RemoveActorAction) AlphaAction(com.badlogic.gdx.scenes.scene2d.actions.AlphaAction) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)

Example 8 with SequenceAction

use of com.badlogic.gdx.scenes.scene2d.actions.SequenceAction in project skin-composer by raeleus.

the class RootTable method refreshStyleProperties.

public void refreshStyleProperties(boolean preserveScroll) {
    if (stylePropertiesTable != null && stylePropertiesScrollPane != null) {
        float scrollY;
        if (preserveScroll) {
            scrollY = stylePropertiesScrollPane.getScrollY();
        } else {
            scrollY = 0;
        }
        stylePropertiesTable.clearChildren();
        addStyleProperties(stylePropertiesTable);
        if (preserveScroll) {
            validate();
            stylePropertiesScrollPane.setSmoothScrolling(false);
            stylePropertiesScrollPane.setScrollY(scrollY);
            stylePropertiesScrollPane.addAction(new SequenceAction(new DelayAction(.1f), new Action() {

                @Override
                public boolean act(float delta) {
                    stylePropertiesScrollPane.setSmoothScrolling(true);
                    return true;
                }
            }));
        }
    }
}
Also used : Action(com.badlogic.gdx.scenes.scene2d.Action) AlphaAction(com.badlogic.gdx.scenes.scene2d.actions.AlphaAction) VisibleAction(com.badlogic.gdx.scenes.scene2d.actions.VisibleAction) RunnableAction(com.badlogic.gdx.scenes.scene2d.actions.RunnableAction) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)

Example 9 with SequenceAction

use of com.badlogic.gdx.scenes.scene2d.actions.SequenceAction in project ultimate-java by pantinor.

the class ShrineScreen method meditationCycle.

private void meditationCycle() {
    party.getSaveGame().lastmeditation = (party.getSaveGame().moves / SHRINE_MEDITATION_INTERVAL) & 0xffff;
    SequenceAction seq = Actions.action(SequenceAction.class);
    for (int i = 0; i < MEDITATION_MANTRAS_PER_CYCLE; i++) {
        seq.addAction(Actions.run(new LogAction()));
        seq.addAction(Actions.delay(1f));
    }
    seq.addAction(Actions.run(new MeditateAction()));
    stage.addAction(seq);
}
Also used : SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)

Example 10 with SequenceAction

use of com.badlogic.gdx.scenes.scene2d.actions.SequenceAction in project ultimate-java by pantinor.

the class CodexScreen method keyUp.

@Override
public boolean keyUp(int keycode) {
    if (state == State.endText) {
        state = State.done;
        SequenceAction seq = Actions.action(SequenceAction.class);
        for (final String s : text1) {
            seq.addAction(Actions.delay(5f));
            seq.addAction(Actions.run(new Runnable() {

                public void run() {
                    logs.add(s);
                }
            }));
        }
        seq.addAction(Actions.run(new Runnable() {

            public void run() {
                mainGame.setScreen(Ultima4.startScreen);
            }
        }));
        stage.addAction(seq);
    }
    return false;
}
Also used : SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)

Aggregations

SequenceAction (com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)19 Creature (objects.Creature)6 Actor (com.badlogic.gdx.scenes.scene2d.Actor)4 Action (com.badlogic.gdx.scenes.scene2d.Action)3 AlphaAction (com.badlogic.gdx.scenes.scene2d.actions.AlphaAction)3 DelayAction (com.badlogic.gdx.scenes.scene2d.actions.DelayAction)3 RunnableAction (com.badlogic.gdx.scenes.scene2d.actions.RunnableAction)3 Drawable (objects.Drawable)3 Tile (objects.Tile)3 Stage (com.badlogic.gdx.scenes.scene2d.Stage)2 MoveByAction (com.badlogic.gdx.scenes.scene2d.actions.MoveByAction)2 VisibleAction (com.badlogic.gdx.scenes.scene2d.actions.VisibleAction)2 Party (objects.Party)2 PartyMember (objects.Party.PartyMember)2 InputMultiplexer (com.badlogic.gdx.InputMultiplexer)1 TiledMap (com.badlogic.gdx.maps.tiled.TiledMap)1 ParallelAction (com.badlogic.gdx.scenes.scene2d.actions.ParallelAction)1 RemoveActorAction (com.badlogic.gdx.scenes.scene2d.actions.RemoveActorAction)1 RotateByAction (com.badlogic.gdx.scenes.scene2d.actions.RotateByAction)1 Dialog (com.badlogic.gdx.scenes.scene2d.ui.Dialog)1