use of com.badlogic.gdx.scenes.scene2d.actions.RunnableAction 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);
}
use of com.badlogic.gdx.scenes.scene2d.actions.RunnableAction 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;
}
use of com.badlogic.gdx.scenes.scene2d.actions.RunnableAction in project var3dframe by Var3D.
the class ActorAnimation method addEndHiddenActions.
/**
* 增加播放完成后隐藏的Actions
* <p>
* frequency播放几遍后隐藏
*/
public void addEndHiddenActions(int frequency) {
RunnableAction end = Actions.run(new Runnable() {
public void run() {
ActorAnimation.this.setVisible(false);
}
});
setRunnableAction(frequency, end);
}
use of com.badlogic.gdx.scenes.scene2d.actions.RunnableAction in project var3dframe by Var3D.
the class ActorAnimation method addEndRemoveActions.
/**
* 增加播放完成后移除的Actions
* <p>
* frequency播放几遍后隐藏
*/
public void addEndRemoveActions(int frequency) {
RunnableAction end = Actions.run(new Runnable() {
public void run() {
ActorAnimation.this.remove();
}
});
setRunnableAction(frequency, end);
}
Aggregations