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

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

Introduction

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

Prototype

Interpolation exp10Out

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

Click Source Link

Usage

From source file:com.jumpbuttonstudios.vikingdodge.ui.popup.TutorialPopup.java

License:Apache License

public void nextSlide() {
    if (slides.size > 0) {
        final TutorialSlide toMoveIn = slides.pop();
        currentSlide = toMoveIn;//  w w  w  .j a  v a 2  s .  c  o  m
        addActor(toMoveIn);
        //         toMoveIn.toFront();
        toMoveIn.moveIn(1, Interpolation.exp10Out);
        toMoveIn.addAction(Actions.run(new Runnable() {

            @Override
            public void run() {
                toMoveIn.setScreenPositions(toMoveIn.getX(), -1000, 0, 0);
            }
        }));
    } else {
        fadeOverlay();
    }
}

From source file:com.trgk.touchwave.gamescene.HitCircle.java

License:Open Source License

public HitCircle(HitFrame frame, float x, float y, Color innerColor) {
    this.mainStage = frame.scene.getStage();
    this.timeSinceLastTouch = 1000;
    this.touchedSet = new HashSet<Integer>();

    final float baseSize = 1.5f;

    // Position actor in frame
    setSize(10, 10);/*from   ww w  . jav a 2  s.co m*/
    this.setOrigin(Align.center);
    setPosition(x, y, Align.center);

    // Create color core
    Image inner = TGPrimitive.circleImage(5, innerColor);
    this.innerImage = inner;
    addActor(inner);
    inner.setPosition(5, 5, Align.center);

    // Set color
    this.baseColor = innerColor;
    Color touchedColor = new Color();
    touchedColor.r = (innerColor.r + 1) / 2;
    touchedColor.g = (innerColor.g + 1) / 2;
    touchedColor.b = (innerColor.b + 1) / 2;
    touchedColor.a = 1;
    this.touchedColor = touchedColor;

    // Create countdown timer anim
    Animation countdownAnimation = CountdownAnim.getInstance().countdownAnimation;
    AnimatedImage anim = new AnimatedImage(countdownAnimation);
    anim.setOrigin(Align.center);
    anim.setScale(13 / 64f);
    addActor(anim);
    anim.setPosition(5, 5, Align.center);

    this.setScale(baseSize * 0.3f);
    this.addAction(Actions.sequence(Actions.scaleTo(baseSize, baseSize, 0.3f, Interpolation.exp10Out),
            Actions.scaleTo(baseSize * 1.5f, baseSize * 1.5f, 6.7f),
            Actions.scaleTo(baseSize * 3f, baseSize * 3f, 0.5f)));

    final HitCircle this2 = this;
    final HashSet<Integer> touchedSet = this.touchedSet;
    this.addListener(new ClickListener() {
        @Override
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            // Allow only up to 5 touches
            int touchIndex = 0;
            for (int i = 0; i < 20; i++) {
                if (Gdx.input.isTouched(i))
                    touchIndex++;
                if (i == pointer)
                    break;
            }
            if (touchIndex <= 5)
                touchedSet.add(pointer);

            return super.touchDown(event, x, y, pointer, button);
        }
    });
}

From source file:com.trgk.touchwave.gamescene.HitFrame.java

License:Open Source License

@Override
public void act(float delta) {
    super.act(delta);

    if (destroyed)
        return;/*from   w  ww.  jav a  2 s  . c  o  m*/

    // All touched -> remove
    if (allCirclesTouched()) {
        this.scene.frameGroup.killFrame(this);
        this.destroyed = true;

        // Destroy animations
        this.clearActions();
        this.addAction(
                Actions.parallel(Actions.sequence(Actions.delay(0.1f), Actions.touchable(Touchable.disabled)),
                        Actions.sequence(Actions.alpha(1), Actions.fadeOut(0.3f, Interpolation.exp10Out),
                                Actions.removeActor())));

        for (HitCircle circle : circles) {
            circle.clearActions();
            circle.addAction(Actions.scaleTo(3f, 3f, 0.3f, Interpolation.circleIn));
        }
    }
}

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

License:Open Source License

@Override
public IFuture<Void> visualize(final EnthrallmentResult result) {
    final Future<Void> future = Future.make();
    SoundManager.instance.playFirstExistingMusicAsSound("ability-" + result.ability.name,
            "ability-enthrallment");
    final ParticleActor particles = new ParticleActor("ability-" + result.ability.name);
    visualizer.viewController.scroller.centerOn(result.target);
    visualizer.viewController.effectLayer.addActor(particles);
    particles.freeOnComplete();//w w  w.j a va  2  s  .  c o m
    particles.setPosition((result.creature.getX() + 0.5f) * ViewController.CELL_SIZE,
            (result.creature.getY() + 0.5f) * ViewController.CELL_SIZE);
    particles.addAction(Actions.sequence(
            Actions.moveTo((result.target.getX() + 0.5f) * ViewController.CELL_SIZE,
                    (result.target.getY() + 0.5f) * ViewController.CELL_SIZE,
                    tmp.set(result.creature.getX() - result.target.getX(),
                            result.creature.getY() - result.target.getY()).len() * 0.15f),
            Actions.run(new Runnable() {
                @Override
                public void run() {
                    particles.effect.allowCompletion();
                    WorldObjectView toView = visualizer.viewController.getView(result.target);
                    toView.addAction(Actions.sequence(Actions.moveBy(0, 5, 0.5f), Actions.run(future),
                            Actions.moveBy(0, -5, 0.2f, Interpolation.exp10Out)));
                }
            })));
    return future;
}

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

License:Open Source License

@Override
public IFuture<Void> visualize(final GiveExpResult result) {
    if (result.exp == 0)
        return Future.completed();
    if (result.creature.initialPlayer != visualizer.viewController.world.viewer) {
        return Future.completed();
    }/*from  www .j av  a  2  s . co  m*/
    final Future<Void> future = new Future<Void>();
    final ViewController viewController = visualizer.viewController;
    final WorldObjectView view = viewController.getView(result.creature);
    String text = "+" + result.exp + " exp";
    final ProfessionDescription profession = result.creature.description.profession;
    final int currentExp = result.creature.description.exp + result.creature.gainedExp;
    final Label label = new Label(text, Config.skin, "default", Color.WHITE);
    label.setPosition(view.getX() + view.getWidth() / 2 - label.getPrefWidth() / 2,
            view.getY() + view.getHeight() / 2 - label.getPrefHeight() / 2);
    label.addAction(Actions.sequence(
            Actions.parallel(Actions.alpha(0, 1f), Actions.moveBy(0, ViewController.CELL_SIZE / 2, 1f)),
            Actions.run(new Runnable() {
                @Override
                public void run() {
                    label.remove();
                    if (profession.getLevel(currentExp) == profession.getLevel(currentExp + result.exp)) {
                        future.happen();
                        return;
                    }
                    final AnimatedActor circle = new AnimatedActor(0.1f,
                            Config.skin.getAtlas().findRegions("animation/levelup-circle"));
                    circle.setPosition(view.getX() + view.getWidth() / 2 - circle.getWidth() / 2,
                            view.getY() + view.getHeight() / 2 - circle.getHeight() / 2);
                    viewController.selectionLayer.addActor(circle);
                    circle.addListener(new ChangeListener() {
                        @Override
                        public void changed(ChangeEvent event, Actor actor) {
                            circle.remove();
                            final TileSubView image = new TileSubView("animation/levelup-white-cube", -1);
                            view.addSubView(image);
                            image.getActor().getColor().a = 0;
                            image.getActor().addAction(
                                    Actions.sequence(Actions.alpha(1f, 0.4f), Actions.run(new Runnable() {
                                        @Override
                                        public void run() {
                                            SoundManager.instance.playMusicAsSound("level-up");
                                            view.addAction(Actions.sequence(
                                                    Actions.moveBy(0, 20, 0.3f, Interpolation.exp10Out),
                                                    Actions.run(new Runnable() {
                                                        @Override
                                                        public void run() {
                                                            view.addAction(Actions.sequence(Actions.delay(0.2f),
                                                                    Actions.run(new Runnable() {
                                                                        @Override
                                                                        public void run() {
                                                                            Label levelUp = new Label(
                                                                                    "LEVEL UP!", Config.skin,
                                                                                    "default", Color.WHITE);
                                                                            levelUp.setPosition((result.creature
                                                                                    .getX() + 0.5f)
                                                                                    * ViewController.CELL_SIZE
                                                                                    - levelUp.getWidth() / 2,
                                                                                    (result.creature.getY()
                                                                                            + 0.5f)
                                                                                            * ViewController.CELL_SIZE);
                                                                            viewController.notificationLayer
                                                                                    .addActor(levelUp);
                                                                            levelUp.addAction(Actions.moveBy(0,
                                                                                    45, 1.5f));
                                                                            levelUp.addAction(Actions.sequence(
                                                                                    Actions.alpha(0, 1.5f),
                                                                                    Actions.removeActor()));

                                                                        }
                                                                    })));
                                                        }
                                                    }),
                                                    Actions.moveBy(0, -20, 0.4f,
                                                            new Interpolation.BounceOut(2)),
                                                    Actions.run(new Runnable() {
                                                        @Override
                                                        public void run() {
                                                            image.getActor()
                                                                    .addAction(Actions.sequence(
                                                                            Actions.alpha(0, 0.4f),
                                                                            Actions.run(new Runnable() {
                                                                                @Override
                                                                                public void run() {
                                                                                    image.getActor().remove();
                                                                                    GameWindow<GiveExpResult> window = new LevelUpWindow();
                                                                                    window.addListener(
                                                                                            new WindowListener() {
                                                                                                @Override
                                                                                                protected void hidden(
                                                                                                        WindowEvent event) {
                                                                                                    future.happen();
                                                                                                }
                                                                                            });
                                                                                    window.show(result);
                                                                                }
                                                                            })));
                                                        }
                                                    })));
                                        }
                                    })));
                        }
                    });
                }
            })));
    viewController.notificationLayer.addActor(label);
    return future;
}

From source file:de.longri.cachebox3.gui.widgets.Slider.java

License:Open Source License

private void startAnimationTo(float targetPos) {
    nameWidget.addAction(Actions.moveTo(0, targetPos, ANIMATION_TIME, Interpolation.exp10Out));
}

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

License:Apache License

/**
 * ??/*w  w w . ja  va2s . c o  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 getRandomFadeInterpolation() {
    switch (new Random().nextInt(14)) {
    case 0:/*from   ww  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  ww  w.  j ava  2 s  .  c  o  m*/
        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;
    }
}