List of usage examples for com.badlogic.gdx.math Interpolation swingIn
Interpolation swingIn
To view the source code for com.badlogic.gdx.math Interpolation swingIn.
Click Source Link
From source file:broken.shotgun.throwthemoon.actors.Boss.java
License:Open Source License
public void startBattle() { Vector2 pointA = new Vector2(getStage().getViewport().getScreenWidth() * 0.7f, getStage().getViewport().getScreenHeight() / 2f); Vector2 pointB = new Vector2(getStage().getViewport().getScreenWidth() * 0.05f, getStage().getViewport().getScreenHeight() / 2f); Vector2 pointC = new Vector2(getStage().getViewport().getScreenWidth() * 0.05f, getStage().getViewport().getScreenHeight() * 0.95f); Vector2 pointD = new Vector2(getStage().getViewport().getScreenWidth() * 0.7f, getStage().getViewport().getScreenHeight() * 0.95f); getStage().screenToStageCoordinates(pointA); getStage().screenToStageCoordinates(pointB); getStage().screenToStageCoordinates(pointC); getStage().screenToStageCoordinates(pointD); addAction(forever(sequence(Actions.delay(3f), Actions.moveTo(pointA.x, pointA.y, 1f, Interpolation.exp10In), Actions.delay(3f), Actions.moveTo(pointB.x, pointB.y, 3f, Interpolation.swingIn), Actions.run(new Runnable() { @Override// w w w . j a va 2s . c o m public void run() { flipX = true; } }), Actions.delay(3f), Actions.moveTo(pointC.x, pointC.y, 1f, Interpolation.exp10In), Actions.delay(3f), Actions.moveTo(pointD.x, pointD.y, 3f, Interpolation.swingIn), Actions.run(new Runnable() { @Override public void run() { flipX = false; } })))); }
From source file:broken.shotgun.throwthemoon.actors.Boss.java
License:Open Source License
private void rage() { if (raging)//from w w w. j a v a 2 s . c om return; raging = true; color = Color.RED; clearActions(); addAction(color(Color.RED, 1f)); Vector2 pointA = new Vector2(getStage().getViewport().getScreenWidth() * 0.7f, getStage().getViewport().getScreenHeight() / 2f); Vector2 pointB = new Vector2(getStage().getViewport().getScreenWidth() * 0.05f, getStage().getViewport().getScreenHeight() / 2f); Vector2 pointC = new Vector2(getStage().getViewport().getScreenWidth() * 0.05f, getStage().getViewport().getScreenHeight() * 0.95f); Vector2 pointD = new Vector2(getStage().getViewport().getScreenWidth() * 0.7f, getStage().getViewport().getScreenHeight() * 0.95f); getStage().screenToStageCoordinates(pointA); getStage().screenToStageCoordinates(pointB); getStage().screenToStageCoordinates(pointC); getStage().screenToStageCoordinates(pointD); addAction(forever(sequence(Actions.delay(1f), Actions.moveTo(pointA.x, pointA.y, 1f, Interpolation.swingIn), Actions.run(new Runnable() { @Override public void run() { flipX = false; } }), Actions.delay(1f), Actions.moveTo(pointC.x, pointC.y, 2f, Interpolation.exp10In), Actions.run(new Runnable() { @Override public void run() { flipX = true; } }), Actions.delay(1f), Actions.moveTo(pointB.x, pointB.y, 1f, Interpolation.swingIn), Actions.delay(1f), Actions.moveTo(pointD.x, pointD.y, 2f, Interpolation.exp10In), Actions.run(new Runnable() { @Override public void run() { flipX = false; } }), Actions.delay(1f), Actions.moveTo(pointC.x, pointC.y, 2f, Interpolation.exp10In), Actions.run(new Runnable() { @Override public void run() { flipX = true; } }), Actions.delay(1f), Actions.moveTo(pointA.x, pointA.y, 1f, Interpolation.swingIn), Actions.run(new Runnable() { @Override public void run() { flipX = false; } }), Actions.delay(1f), Actions.moveTo(pointB.x, pointB.y, 1f, Interpolation.swingIn), Actions.run(new Runnable() { @Override public void run() { flipX = true; } })))); }
From source file:com.kasetagen.game.bubblerunner.screen.BubbleRunnerMenu.java
License:Creative Commons License
private void showMainMenu(final boolean isFromHighScore) { GenericGroup targetGroup = isFromHighScore ? highScoreGroup : optionsGroup; float targetX = isFromHighScore ? -1280f : 1280f; targetGroup.addAction(Actions.sequence(Actions.moveTo(targetX, 0f, 1f, Interpolation.swingIn), Actions.run(new Runnable() { @Override// w w w . j av a2 s . com public void run() { menuGroup.addAction(Actions.moveTo(0f, 0f, 1f, Interpolation.fade)); isMenuView = true; } }))); }
From source file:com.spaceapps.liftoffgame.screens.GameScreen.java
public void rocketEngineAnimation() { MoveToAction action = Actions.action(MoveToAction.class); action.setPosition(game.rocket.getX(), 60); action.setInterpolation(Interpolation.swingIn); action.setDuration(0.8f);//w w w .jav a 2 s . com game.rocket.addAction(action); }
From source file:com.vlaaad.common.ui.GameWindow.java
License:Open Source License
public final void hide() { if (!shown)// w w w.j a v a 2 s. co m return; WindowListener.WindowEvent event = Pools.obtain(WindowListener.WindowEvent.class) .setEventType(WindowListener.EventType.hide).setWindow(this); boolean cancelled = fire(event); Pools.free(event); if (cancelled) { return; } shown = false; background.clearActions(); table.clearActions(); WindowManager.instance.remove(this); float w = useParentSize() ? getParent().getWidth() : getStage().getWidth(); float h = useParentSize() ? getParent().getHeight() : getStage().getHeight(); isHiding = true; table.addAction(Actions.sequence( Actions.parallel(Actions.scaleTo(0f, 0f, 0.4f, Interpolation.swingIn), Actions.moveTo(w / 2, h / 2, 0.4f, Interpolation.swingIn), Actions.alpha(0f, 0.4f)), Actions.scaleTo(0, 0))); background.addAction(Actions.sequence(Actions.alpha(0, 0.3f), Actions.run(new Runnable() { @Override public void run() { WindowListener.WindowEvent event = Pools.obtain(WindowListener.WindowEvent.class) .setEventType(WindowListener.EventType.hidden).setWindow(GameWindow.this); fire(event); Pools.free(event); getStage().removeListener(resizeListener); GameWindow.this.remove(); onHide(); isHiding = false; } }))); }
From source file:com.vlaaad.dice.game.world.controllers.SpawnController.java
License:Open Source License
private void refreshStartButton() { startButton.setDisabled(placed.size == 0); startButton.clearActions();// w ww . j a va2 s .c o m if (placed.size == 0) { startButton.addAction(Actions.moveTo(world.stage.getWidth() / 2 - startButton.getWidth() / 2, world.stage.getHeight() + startButton.getHeight(), 0.5f, Interpolation.swingIn)); } else { startButton.addAction(Actions.moveTo(world.stage.getWidth() / 2 - startButton.getWidth() / 2, world.stage.getHeight() - startButton.getHeight() - 4, 0.5f, Interpolation.swingOut)); } }
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 . java 2 s. co 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; } }