Search in sources :

Example 1 with AlphaAction

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

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

the class DeathAnim method add.

@Override
protected void add() {
    if (getActor() == null) {
        return;
    }
    // AnimMaster.getInstance().addActor(getActor());
    // getActor().setPosition(getOrigin().x, getOrigin().y);
    AlphaAction action = ActorMaster.addFadeOutAction(getActor());
    action.setDuration(duration);
    ActorMaster.addRemoveAfter(getActor());
}
Also used : AlphaAction(com.badlogic.gdx.scenes.scene2d.actions.AlphaAction)

Example 3 with AlphaAction

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

use of com.badlogic.gdx.scenes.scene2d.actions.AlphaAction 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)

Aggregations

AlphaAction (com.badlogic.gdx.scenes.scene2d.actions.AlphaAction)4 DelayAction (com.badlogic.gdx.scenes.scene2d.actions.DelayAction)2 SequenceAction (com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)2 Color (com.badlogic.gdx.graphics.Color)1 RemoveActorAction (com.badlogic.gdx.scenes.scene2d.actions.RemoveActorAction)1 RunnableAction (com.badlogic.gdx.scenes.scene2d.actions.RunnableAction)1 VisibleAction (com.badlogic.gdx.scenes.scene2d.actions.VisibleAction)1