Example usage for com.badlogic.gdx.math Interpolation circleOut

List of usage examples for com.badlogic.gdx.math Interpolation circleOut

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Interpolation circleOut.

Prototype

Interpolation circleOut

To view the source code for com.badlogic.gdx.math Interpolation circleOut.

Click Source Link

Usage

From source file:broken.shotgun.throwthemoon.actors.Enemy.java

License:Open Source License

public void takeDamage(int direction) {
    health--;/*from www.java2s .  c o  m*/

    hitSfx.play();

    if (health <= 0) {
        die();
        return;
    }

    addAction(sequence(
            parallel(Actions.moveBy(20 * direction, 0, 0.3f, Interpolation.circleOut),
                    sequence(color(Color.BLACK, 0.15f), color(Color.WHITE, 0.15f))),
            Actions.moveTo(getX(), getY(), 0.1f, Interpolation.circleIn)));
}

From source file:com.strategames.catchdastars.dialogs.LevelCompleteDialog.java

License:Open Source License

private void showScoreActor() {

    if (!scoreItemIterator.hasNext()) { //start next animation phase
        animationController();//from  w w w .  j av a  2 s .c  o  m
        return;
    }

    Score.ScoreItem scoreItem = scoreItemIterator.next();

    final int increment = scoreItem.getMultiplier();
    final int amount = scoreItem.getScore();
    final SoundEffect incrementSound = SoundEffect.getSoundForIncrement(increment);

    Image image = scoreItem.getImage();
    image.setScaling(Scaling.stretch);
    double scaleFactor = this.maxImageHeight / (double) image.getHeight();
    float height = this.maxImageHeight;
    float width = (float) (image.getWidth() * scaleFactor);

    Table scoreItemTable = new Table();
    scoreItemTable.add(image).padRight(20f).width(width).height(height);

    final Label label = new Label("", getSkin());
    scoreItemTable.add(label).width(50f);

    this.animPosition.x = 100f;
    this.animPosition.y = this.top - ((this.maxImageHeight + this.padding) * scoreActors.size());

    scoreItemTable.setPosition(animPosition.x, -height);

    this.count = 0;
    this.delayCount = 0;

    scoreItemTable.addAction(
            sequence(moveTo(animPosition.x, animPosition.y, 1f, Interpolation.circleOut), new Action() {
                @Override
                public boolean act(float delta) {
                    if (count <= amount) {
                        if (delayCount < 1) {
                            label.setText(String.valueOf(count));
                            if (count > 0) {
                                incrementSound.play();
                            }
                            count += increment;
                            delayCount = delay;
                        }
                        delayCount--;
                        return false;
                    } else {
                        showScoreActor();
                        return true;
                    }
                }

            }));

    scoreActors.add(new ScoreActor(scoreItemTable, scoreItem));
    super.stage.addActor(scoreItemTable);
}

From source file:com.strategames.catchdastars.dialogs.LevelCompleteDialog.java

License:Open Source License

private void showCashRegistry(final float x, final float y) {
    this.cashRegister = new Table();
    final float scale = 1.2f;
    Image image = new Image(Textures.getInstance().cashRegister);
    image.setScaling(Scaling.stretch);/*from   w ww  .j ava2  s  .  c  om*/
    double scaleFactor = this.maxImageHeight / (double) image.getHeight();
    float height = this.maxImageHeight;
    float width = (float) (image.getWidth() * scaleFactor);
    float xPosition = x + width;
    this.cashRegister.add(image).padRight(20f).width(width);
    this.cashRegister.setTransform(true);
    this.cashRegister.setHeight(height);
    this.cashRegister.setPosition(xPosition, -height);
    this.cashRegister.scaleBy(scale);
    this.totalScoreLabel = new Label(
            String.valueOf(this.score.getCumulatedScore() - this.score.getTotalScoreFromScoreItems()),
            getSkin());
    this.totalScoreLabel.scaleBy(scale);
    this.cashRegister.add(totalScoreLabel).width(50);

    float finalYPosition = y - height - this.padding;
    this.cashRegister
            .addAction(sequence(moveTo(xPosition, finalYPosition, 1f, Interpolation.circleOut), new Action() {
                @Override
                public boolean act(float delta) {
                    animationController();
                    return true;
                }
            }));

    super.stage.addActor(this.cashRegister);

    cashRegisterOpenSound.play();
}

From source file:com.strategames.catchdastars.dialogs.LevelCompleteDialog.java

License:Open Source License

private void showTotalScore() {
    float x = (super.stage.getWidth() / 2f) - (this.cashRegister.getWidth() / 2f);
    float y = (super.stage.getHeight() / 2f) - (this.cashRegister.getHeight() / 2f);

    int size = this.chalkLines.size();
    for (int i = 0; i < size; i++) {
        ChalkLine line = this.chalkLines.get(i);
        line.addAction(fadeOut(1f, Interpolation.circleOut));
    }/*from w w w  . j  a v a2s .com*/

    getMessageLabel().addAction(fadeOut(1f, Interpolation.circleOut));

    this.cashRegister
            .addAction(
                    sequence(
                            parallel(com.badlogic.gdx.scenes.scene2d.actions.Actions.scaleBy(0.5f, 0.5f, 1f,
                                    Interpolation.circle), moveTo(x, y, 1f, Interpolation.circle)),
                            new Action() {

                                @Override
                                public boolean act(float delta) {
                                    cashRegister.remove();
                                    stage.addActor(cashRegister);
                                    return true;
                                }

                            }));
}

From source file:com.vlaaad.dice.game.world.view.visualizers.actions.TeleportVisualizer.java

License:Open Source License

@Override
public IFuture<Void> visualize(final TeleportResult result) {
    final Future<Void> future = new Future<Void>();
    final Actor in = new AnimationSubView(0.125f, compose("animation/teleport-in"), Animation.PlayMode.NORMAL)
            .getActor();//w  w  w  .  j a va  2 s  . c o m
    in.setPosition(
            result.creature.getX() * ViewController.CELL_SIZE + (ViewController.CELL_SIZE - in.getWidth()) / 2,
            result.creature.getY() * ViewController.CELL_SIZE + ViewController.CELL_SIZE * 1.5f);
    visualizer.viewController.effectLayer.addActor(in);
    in.addListener(new AnimationListener() {
        @Override
        protected void onAnimationEvent(AnimationEvent event) {
            in.remove();
        }
    });
    WorldObjectView view = visualizer.viewController.getView(result.creature);
    visualizer.viewController.scroller.centerOn(result.creature);
    view.addAction(Actions.sequence(Actions.delay(0.625f), Actions.run(new Runnable() {
        @Override
        public void run() {
            SoundManager.instance.playSound("ability-teleport");
        }
    }), Actions.parallel(Actions.alpha(0, 0.5f, Interpolation.circleOut), Actions.moveBy(0, MOVE_OFFSET, 0.5f)),
            Actions.moveTo(result.coordinate.x() * ViewController.CELL_SIZE,
                    result.coordinate.y() * ViewController.CELL_SIZE + MOVE_OFFSET),
            Actions.run(new Runnable() {
                @Override
                public void run() {
                    final Actor out = new AnimationSubView(0.125f, compose("animation/teleport-out"),
                            Animation.PlayMode.NORMAL).getActor();
                    out.setPosition(
                            result.coordinate.x() * ViewController.CELL_SIZE
                                    + (ViewController.CELL_SIZE - out.getWidth()) / 2,
                            result.coordinate.y() * ViewController.CELL_SIZE + ViewController.CELL_SIZE * 1.5f);
                    visualizer.viewController.scroller.centerOn(result.coordinate);
                    visualizer.viewController.effectLayer.addActor(out);
                    out.addListener(new AnimationListener() {
                        @Override
                        protected void onAnimationEvent(AnimationEvent event) {
                            out.remove();
                        }
                    });
                }
            }), Actions.delay(0.625f), Actions.run(new Runnable() {
                @Override
                public void run() {
                    SoundManager.instance.playSound("ability-teleport");
                }
            }), Actions.parallel(Actions.alpha(1f, 0.5f, Interpolation.circleIn),
                    Actions.moveBy(0, -MOVE_OFFSET + 2, 0.5f)),
            Actions.run(new Runnable() {
                @Override
                public void run() {
                    future.happen();
                }
            })));

    return future;
}

From source file:core.september.morra.screens.transitions.ScreenTransitionFlash.java

License:Apache License

@Override
public void render(SpriteBatch batch, Texture currScreen, Texture nextScreen, float alpha) {
    float w = currScreen.getWidth();
    float h = currScreen.getHeight();
    alpha = Interpolation.circleOut.apply(alpha);

    Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    batch.begin();//w  w w . j  av  a 2 s  . c o m
    batch.setColor(1, 1, 1, 1);
    batch.draw(currScreen, 0, 0, 0, 0, w, h, 1, 1, 0, 0, 0, currScreen.getWidth(), currScreen.getHeight(),
            false, true);
    batch.setColor(1, 1, 1, alpha);
    batch.draw(nextScreen, 0, 0, 0, 0, w, h, 1, 1, 0, 0, 0, nextScreen.getWidth(), nextScreen.getHeight(),
            false, true);
    batch.end();
}

From source file:es.eucm.ead.engine.systems.effects.transitions.ScaleAndFade.java

License:Open Source License

private void initialize(float duration, boolean out) {
    this.out = out;
    this.duration = duration;
    this.easing = out ? Interpolation.circleOut : Interpolation.circleIn;
}

From source file:net.mwplay.cocostudio.ui.CocoStudioUIEditor.java

License:Apache License

/**
 * ??//from   w ww  .ja v a2s . co m
 */
public Interpolation getInterpolation(int tweenType) {
    switch (tweenType) {
    case 0:
        return Interpolation.linear;
    case 1:
        return Interpolation.sineIn;
    case 2:
        return Interpolation.sineOut;
    case 3:
        return Interpolation.sine;
    case 4:
        return Interpolation.linear; //??Quad_EaseIn
    case 5:
        return Interpolation.linear; //??Quad_EaseOut
    case 6:
        return Interpolation.linear; //??Quad_EaseInOut
    case 7:
        return Interpolation.linear; //??Cubic_EaseIn
    case 8:
        return Interpolation.linear; //??Cubic_EaseOut
    case 9:
        return Interpolation.linear; //??Cubic_EaseInOut
    case 10:
        return Interpolation.linear; //??Quart_EaseIn
    case 11:
        return Interpolation.linear; //??Quart_EaseOut
    case 12:
        return Interpolation.linear; //??Quart_EaseInOut
    case 13:
        return Interpolation.linear; //??Quint_EaseIn
    case 14:
        return Interpolation.linear; //??Quint_EaseOut
    case 15:
        return Interpolation.linear; //??Quint_EaseInOut
    case 16:
        return Interpolation.exp10In;
    case 17:
        return Interpolation.exp10Out;
    case 18:
        return Interpolation.exp10;
    case 19:
        return Interpolation.circleIn;
    case 20:
        return Interpolation.circleOut;
    case 21:
        return Interpolation.circle;
    case 22:
        return Interpolation.elasticIn;
    case 23:
        return Interpolation.elasticOut;
    case 24:
        return Interpolation.elastic;
    case 25:
        return Interpolation.linear; //??Back_EaseIn
    case 26:
        return Interpolation.linear; //??Back_EaseOut
    case 27:
        return Interpolation.linear; //??Back_EaseInOut
    case 28:
        return Interpolation.bounceIn;
    case 29:
        return Interpolation.bounceOut;
    case 30:
        return Interpolation.bounce;

    default:
        return Interpolation.linear;
    }
}

From source file:org.pidome.client.photoframe.screens.photoscreen.actors.PhotosActor.java

public Interpolation getRandomInterpolation() {
    switch (new Random().nextInt(20)) {
    case 0:/*  w w w. j  a  v  a  2s  .  com*/
        return Interpolation.bounce;
    case 1:
        return Interpolation.bounceIn;
    case 2:
        return Interpolation.bounceOut;
    case 3:
        return Interpolation.circle;
    case 4:
        return Interpolation.circleIn;
    case 5:
        return Interpolation.circleOut;
    case 6:
        return Interpolation.exp10;
    case 7:
        return Interpolation.exp10In;
    case 8:
        return Interpolation.exp10Out;
    case 9:
        return Interpolation.exp5;
    case 10:
        return Interpolation.exp5In;
    case 11:
        return Interpolation.exp5Out;
    case 12:
        return Interpolation.fade;
    case 13:
        return Interpolation.linear;
    case 14:
        return Interpolation.sine;
    case 15:
        return Interpolation.sineIn;
    case 16:
        return Interpolation.sineOut;
    case 17:
        return Interpolation.swing;
    case 18:
        return Interpolation.swingIn;
    case 19:
        return Interpolation.swingOut;
    default:
        return Interpolation.linear;
    }
}