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);
}
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;
}
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;
}
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;
}
}));
}
}
}
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;
}
Aggregations