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

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

Introduction

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

Prototype

Interpolation exp5In

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

Click Source Link

Usage

From source file:broken.shotgun.throwthemoon.stages.GameStage.java

License:Open Source License

public void fadeOut(Runnable runnable) {
    if (fadingOut)
        return;//from   w  w  w. ja  v  a 2 s  .  co  m

    fadingOut = true;

    addActor(moon);
    moon.startFalling();

    screenFadeActor.addAction(Actions.sequence(Actions.color(Color.CLEAR),
            Actions.color(Color.RED, 5f, Interpolation.exp5In), Actions.run(runnable)));
    addActor(screenFadeActor);
}

From source file:com.jmolina.orb.widgets.ui.GameTitle.java

License:Open Source License

/**
 * Small easter egg xD/* w w w . j  av  a  2  s .  c o m*/
 *
 * @return A listener performing an animation over {@link #orb}
 */
private ClickListener getEasterListener() {
    return new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            clicks++;

            orb.addAction(Actions.rotateBy(360 * (float) Math.random(), 1, Interpolation.sineOut));

            if (clicks >= 5) {
                clicks = 0;
                orb.addAction(sequence(
                        parallel(Actions.moveBy(Utils.cell(-4), 0, 0.75f, Interpolation.sineIn),
                                Actions.rotateBy(180, 0.75f, Interpolation.exp5In)),
                        Actions.moveTo(Utils.cell(12), orb.getY(), 0),
                        parallel(Actions.moveTo(0, 0, 2, Interpolation.sineOut),
                                Actions.rotateBy(720, 2, Interpolation.pow2Out))));

                gameManager.unlockAchievement(PlayServices.Achievement.EasterHunter);
            }
        }
    };
}

From source file:io.piotrjastrzebski.sfg.screen.MainMenuScreen.java

License:Open Source License

private Actor createPlayButton() {
    final TextureRegionDrawable rocketOnDrawable = new TextureRegionDrawable(assets.getUIRegion("rocket_on"));
    final Image rocket = new Image(new TextureRegionDrawable(assets.getUIRegion("rocket")));
    // so rocket isnt stretched with glowing background in stack
    rocket.setScaling(Scaling.none);// ww w.  j ava 2  s  .c  om
    // glow to direct player to play button after few seconds
    final Image glow = new Image(new NinePatchDrawable(assets.getUiAtlas().createPatch("button_glow")));
    // invisible at start
    glow.setColor(1, 1, 1, 0);
    // after 2s start fading in and out forever
    glow.addAction(Actions.delay(2, Actions.forever(
            Actions.sequence(Actions.fadeIn(1, Interpolation.fade), Actions.fadeOut(1, Interpolation.fade)))));

    final Button startGame = new Button(assets.getSkin());
    // pulse the button with glow
    startGame.setTransform(true);
    startGame.setScale(1.25f);
    startGame.setOrigin(startGame.getWidth() / 2, startGame.getHeight() / 2);
    startGame.addAction(Actions.delay(2,
            Actions.forever(Actions.sequence(Actions.scaleTo(1.33f, 1.33f, 1, Interpolation.fade),
                    Actions.scaleTo(1.25f, 1.25f, 1, Interpolation.fade)))));
    startGame.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            // kick back the button a bit
            startGame.clearActions();
            glow.clearActions();
            startGame.addAction(Actions.moveBy(-30, 0, 0.5f, Interpolation.exp5Out));
            rocket.setDrawable(rocketOnDrawable);
            // fire off the rocket and change screen when its off screen
            rocket.addAction(
                    Actions.sequence(Actions.moveBy(stage.getWidth() / 2 + 100, 0, 0.5f, Interpolation.exp5In),
                            // change the screen when rocket moves off screen
                            Actions.run(new Runnable() {
                                @Override
                                public void run() {
                                    Locator.getApp().setScreen(new DifficultySelectScreen());
                                }
                            })));
            playButtonPressSound();
        }
    });
    // stack so we can have rocket and glow overlap
    final Stack stack = new Stack();
    stack.add(glow);
    stack.add(rocket);
    // fill the button but leave pad for border
    startGame.add(stack).fill().expand().pad(4);
    return startGame;
}

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

public Interpolation getRandomFadeInterpolation() {
    switch (new Random().nextInt(14)) {
    case 0://from   w w w  .j a  va 2  s  .c om
        return Interpolation.exp10;
    case 1:
        return Interpolation.exp10In;
    case 2:
        return Interpolation.exp10Out;
    case 3:
        return Interpolation.exp5;
    case 4:
        return Interpolation.exp5In;
    case 5:
        return Interpolation.exp5Out;
    case 6:
        return Interpolation.fade;
    case 7:
        return Interpolation.linear;
    case 8:
        return Interpolation.sine;
    case 9:
        return Interpolation.sineIn;
    case 10:
        return Interpolation.sineOut;
    case 11:
        return Interpolation.bounce;
    case 12:
        return Interpolation.bounceIn;
    case 13:
        return Interpolation.bounceOut;
    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:/*from w  w  w.  j a  v  a 2s .c om*/
        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;
    }
}