Example usage for com.badlogic.gdx.scenes.scene2d.actions SequenceAction SequenceAction

List of usage examples for com.badlogic.gdx.scenes.scene2d.actions SequenceAction SequenceAction

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.actions SequenceAction SequenceAction.

Prototype

public SequenceAction() 

Source Link

Usage

From source file:com.gamestudio24.martianrun.actors.menu.Tutorial.java

License:Apache License

public Tutorial(Rectangle bounds, String assetsId, String text) {
    this.bounds = bounds;
    this.text = text;
    textureRegion = AssetsManager.getTextureRegion(assetsId);
    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(Actions.delay(4f));
    sequenceAction.addAction(Actions.removeActor());
    addAction(sequenceAction);/* w  w w.j a  va  2  s . c om*/
    font = AssetsManager.getSmallestFont();
    setWidth(bounds.width);
    setHeight(bounds.height);
}

From source file:com.nicholaschirkevich.game.model.AchiveView.java

License:Apache License

public AchiveView(Rectangle bounds, String assetsId) {
    this.bounds = bounds;
    textureRegion = AssetsManager.getTextureRegion(assetsId);
    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(Actions.delay(1.5f));
    sequenceAction.addAction(Actions.removeActor());
    addAction(sequenceAction);// w w  w  . j a  v  a2 s  .co m
    setWidth(bounds.width);
    setHeight(bounds.height);
}

From source file:com.nicholaschirkevich.game.model.boosters.TurnBonusView.java

License:Apache License

public TurnBonusView(Rectangle bounds, String assetsId) {
    this.bounds = bounds;
    textureRegion = AssetsManager.getTextureRegion(assetsId);
    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(Actions.delay(1.5f));
    sequenceAction.addAction(Actions.removeActor());
    addAction(sequenceAction);//ww w .  j  a  v a2 s  .  c  om
    setWidth(bounds.width);
    setHeight(bounds.height);
}

From source file:com.nicholaschirkevich.game.model.GearView.java

License:Apache License

public GearView(Rectangle bounds, String gearNumberText, final String achivesText) {
    this.bounds = bounds;
    this.achivesText = achivesText;
    gearText = new Label(gearNumberText, AssetsManager.getUiSkin());
    gearText.setBounds(GameRuners.WIDTH / 4 - gearText.getWidth() / 3, GameRuners.HEIGHT / 4 - (height / 2),
            width, height);/*  ww  w . j ava  2 s  .co  m*/
    gearText.setFontScale(GEAR_TEXT_FONT_SCALE_X, GEAR_TEXT_FONT_SCALE_Y);

    gearText.setColor(Color.ORANGE);

    achiveLabel = new Label(achivesText, AssetsManager.getUiSkin());
    achiveLabel.setBounds(GameRuners.WIDTH / 4 - achiveLabel.getWidth() / 2 + 10,
            GameRuners.HEIGHT / 4 - (height / 2), width, height);
    achiveLabel.setFontScale(ACHIVE_LABEL_FONT_SCALE_X, ACHIVE_LABEL_FONT_SCALE_Y);

    achiveLabel.setColor(achiveLabel.getColor().r, achiveLabel.getColor().g, achiveLabel.getColor().b, 0f);

    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(Actions.delay(1.5f));
    sequenceAction.addAction(new ViewActionAlfa(gearText));
    sequenceAction.addAction(Actions.delay(0.5f));
    sequenceAction.addAction(new Action() {
        @Override
        public boolean act(float delta) {
            achiveLabel.setColor(gearText.getColor().r, gearText.getColor().g, gearText.getColor().b, 1f);
            achiveLabel.setColor(Color.RED);
            achiveLabel.setText(achivesText);
            return true;
        }
    });
    sequenceAction.addAction(Actions.delay(1.5f));
    sequenceAction.addAction(new ViewActionAlfa(achiveLabel));
    //
    sequenceAction.addAction(Actions.removeActor());
    addAction(sequenceAction);
    setWidth(bounds.width);
    setHeight(bounds.height);

}

From source file:com.ray3k.skincomposer.RootTable.java

License:Open Source License

private void display(final String text) {
    SequenceAction sequenceAction = new SequenceAction();
    if (statusLabel.isVisible()) {
        statusLabel.clearActions();/*w w  w .  j  a v a 2  s.  c  o m*/
        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);
}