use of com.badlogic.gdx.scenes.scene2d.actions.VisibleAction 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);
}
Aggregations