Search in sources :

Example 1 with DelayAction

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

the class RootTable method display.

private void display(final String text) {
    SequenceAction sequenceAction = new SequenceAction();
    if (statusLabel.isVisible()) {
        statusLabel.clearActions();
        AlphaAction alphaAction = new AlphaAction();
        alphaAction.setAlpha(0.0f);
        alphaAction.setDuration(.25f);
        sequenceAction.addAction(alphaAction);
        RunnableAction runnableAction = new RunnableAction();
        runnableAction.setRunnable(() -> {
            statusLabel.setText(text);
        });
        sequenceAction.addAction(runnableAction);
        alphaAction = new AlphaAction();
        alphaAction.setAlpha(1.0f);
        alphaAction.setDuration(.25f);
        sequenceAction.addAction(alphaAction);
        DelayAction delayAction = new DelayAction();
        delayAction.setDuration(3.0f);
        sequenceAction.addAction(delayAction);
        alphaAction = new AlphaAction();
        alphaAction.setAlpha(0.0f);
        alphaAction.setDuration(1.5f);
        sequenceAction.addAction(alphaAction);
        VisibleAction visibleAction = new VisibleAction();
        visibleAction.setVisible(false);
        sequenceAction.addAction(visibleAction);
    } else {
        statusLabel.setText(text);
        statusLabel.clearActions();
        statusLabel.setVisible(true);
        AlphaAction alphaAction = new AlphaAction();
        alphaAction.setAlpha(1.0f);
        alphaAction.setDuration(.5f);
        sequenceAction.addAction(alphaAction);
        DelayAction delayAction = new DelayAction();
        delayAction.setDuration(3.0f);
        sequenceAction.addAction(delayAction);
        alphaAction = new AlphaAction();
        alphaAction.setAlpha(0.0f);
        alphaAction.setDuration(1.5f);
        sequenceAction.addAction(alphaAction);
        VisibleAction visibleAction = new VisibleAction();
        visibleAction.setVisible(false);
        sequenceAction.addAction(visibleAction);
    }
    statusLabel.addAction(sequenceAction);
}
Also used : RunnableAction(com.badlogic.gdx.scenes.scene2d.actions.RunnableAction) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) AlphaAction(com.badlogic.gdx.scenes.scene2d.actions.AlphaAction) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction) VisibleAction(com.badlogic.gdx.scenes.scene2d.actions.VisibleAction)

Example 2 with DelayAction

use of com.badlogic.gdx.scenes.scene2d.actions.DelayAction in project Eidolons by IDemiurge.

the class Weapon3dAnim method getAction.

@Override
protected Action getAction() {
    setColor(new Color(1, 1, 1, 1));
    AlphaAction alphaAction = (AlphaAction) ActorMaster.getAction(AlphaAction.class);
    alphaAction.setDuration(getDuration() / 2);
    alphaAction.setAlpha(0);
    DelayAction delayed = new DelayAction(getDuration() / 2);
    delayed.setAction(alphaAction);
    return delayed;
}
Also used : Color(com.badlogic.gdx.graphics.Color) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) AlphaAction(com.badlogic.gdx.scenes.scene2d.actions.AlphaAction)

Example 3 with DelayAction

use of com.badlogic.gdx.scenes.scene2d.actions.DelayAction 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 4 with DelayAction

use of com.badlogic.gdx.scenes.scene2d.actions.DelayAction 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 5 with DelayAction

use of com.badlogic.gdx.scenes.scene2d.actions.DelayAction in project Eidolons by IDemiurge.

the class ActionCostTooltip method getDescriptionAction.

private Action getDescriptionAction() {
    DelayAction addAfter = new DelayAction();
    Action add = new Action() {

        @Override
        public boolean act(float delta) {
            if (getActor() instanceof Group) {
                ((TablePanel) getActor()).row();
                ((TablePanel) getActor()).addElement(getDescription());
            }
            return true;
        }
    };
    // TODO add move up action!
    add.setActor(this);
    addAfter.setAction(add);
    addAfter.setDuration(0.7f);
    addAfter.setTarget(this);
    return addAfter;
}
Also used : Group(com.badlogic.gdx.scenes.scene2d.Group) Action(com.badlogic.gdx.scenes.scene2d.Action) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Aggregations

DelayAction (com.badlogic.gdx.scenes.scene2d.actions.DelayAction)5 Action (com.badlogic.gdx.scenes.scene2d.Action)3 AlphaAction (com.badlogic.gdx.scenes.scene2d.actions.AlphaAction)3 RunnableAction (com.badlogic.gdx.scenes.scene2d.actions.RunnableAction)3 SequenceAction (com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)3 VisibleAction (com.badlogic.gdx.scenes.scene2d.actions.VisibleAction)2 Color (com.badlogic.gdx.graphics.Color)1 Group (com.badlogic.gdx.scenes.scene2d.Group)1 Dialog (com.badlogic.gdx.scenes.scene2d.ui.Dialog)1 TablePanel (eidolons.libgdx.gui.panels.TablePanel)1