/** Moves the actor instantly. */ static public MoveToAction moveTo (float x, float y) { return moveTo(x, y, 0, null); }
/** Moves the actor instantly. */ static public MoveToAction moveTo (float x, float y) { return moveTo(x, y, 0, null); }
static public MoveToAction moveTo (float x, float y, float duration) { return moveTo(x, y, duration, null); }
static public MoveToAction moveTo (float x, float y, float duration) { return moveTo(x, y, duration, null); }
/** Moves the actor instantly. */ static public MoveToAction moveTo (float x, float y) { return moveTo(x, y, 0, null); }
static public MoveToAction moveTo (float x, float y, float duration) { return moveTo(x, y, duration, null); }
public void sendAwayInstructions( final JungleMainMenuScreen jungleMainMenuScreen) { // jungleMainMenuScreen.instructions.addAction(Actions.moveTo( 0 - AppSettings.SCREEN_W, 0, 0.5f)); } }
public void sendInInstructions( final JungleMainMenuScreen jungleMainMenuScreen) { // float widthAsX = jungleMainMenuScreen.btnSwipeForMenu.getWidth(); jungleMainMenuScreen.instructions.addAction(Actions.moveTo( 0 - widthAsX, 0, 0.5f)); }
public void sendAwayGameName(final JungleMainMenuScreen jungleMainMenuScreen) { jungleMainMenuScreen.gameName.addAction(Actions.moveTo( AppSettings.SCREEN_W / 2 - jungleMainMenuScreen.gameName.getWidth() / 2, AppSettings.SCREEN_H + jungleMainMenuScreen.gameName.getHeight(), 0.5f)); }
public void sendInGameName(final JungleMainMenuScreen jungleMainMenuScreen) { jungleMainMenuScreen.gameName.addAction(Actions.moveTo( AppSettings.SCREEN_W / 2 - jungleMainMenuScreen.gameName.getWidth() / 2, AppSettings.SCREEN_H - jungleMainMenuScreen.gameName.getHeight(), 0.5f)); }
void show() { scorer.pause(); scorer.saveScore(); // Save the last input processor so then we can return the handle to it lastInputProcessor = Gdx.input.getInputProcessor(); Gdx.input.setInputProcessor(this); shown = true; hiding = false; addAction(Actions.moveTo(0, Gdx.graphics.getHeight())); addAction(Actions.moveTo(0, 0, 0.75f, Interpolation.swingOut)); }
public MainScene() { actor = new AdvanceSpriteImage(new AnimationSprite(0.05f, Engine.resource("Anim", TextureAtlas.class), "fly")); actor.setPosition(200, 100); actor.addAction(Actions.forever( Actions.sequence( Actions.moveTo(300, 100, 1, Interpolation.bounceOut), Actions.moveBy(200, 0, 1, Interpolation.bounceOut), Actions.moveBy(0, 250, 1), Actions.moveTo(200, 350, 1, Interpolation.swingOut), Actions.moveTo(200, 100, 1, Interpolation.swingOut) ) )); this.addActor(actor); }
@Override public void touchDown(InputEvent event, float x, float y, int pointer, int button) { super.touchDown(event, x, y, pointer, button); // jungleMainMenuScreen.btnSocialFacebook.addAction(Actions.moveTo( jungleMainMenuScreen.btnSocialFacebook.getX(), AppSettings.SCREEN_H - jungleMainMenuScreen.btnSocialFacebook .getHeight(), touchAnimationDuration)); }
@Override public void touchDown(InputEvent event, float x, float y, int pointer, int button) { super.touchDown(event, x, y, pointer, button); // jungleMainMenuScreen.btnSocialTwitter.addAction(Actions.moveTo( jungleMainMenuScreen.btnSocialTwitter.getX(), AppSettings.SCREEN_H - jungleMainMenuScreen.btnSocialTwitter .getHeight(), touchAnimationDuration)); }
@Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) { super.touchDown(event, x, y, pointer, button); // jungleMainMenuScreen.btnSocialTwitter.addAction(Actions.moveTo( jungleMainMenuScreen.btnSocialTwitter.getX(), AppSettings.SCREEN_H - jungleMainMenuScreen.btnSocialTwitter .getHeight() / 1.25f, touchAnimationDuration)); } });
@Override public void touchDown(InputEvent event, float x, float y, int pointer, int button) { super.touchDown(event, x, y, pointer, button); // jungleMainMenuScreen.btnSocialGoogle.addAction(Actions.moveTo( jungleMainMenuScreen.btnSocialGoogle.getX(), AppSettings.SCREEN_H - jungleMainMenuScreen.btnSocialGoogle .getHeight(), touchAnimationDuration)); }
@Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) { super.touchDown(event, x, y, pointer, button); // jungleMainMenuScreen.btnSocialGoogle.addAction(Actions.moveTo( jungleMainMenuScreen.btnSocialGoogle.getX(), AppSettings.SCREEN_H - jungleMainMenuScreen.btnSocialGoogle .getHeight() / 1.25f, touchAnimationDuration)); } });
public void hide() { if (isVisible()) addAction(Actions.sequence(Actions.moveTo(orgPos.x, orgPos.y, .1f), Actions.hide())); }
public void show() { if (!isVisible()) { resize((int) getStage().getCamera().viewportWidth, (int) getStage().getCamera().viewportHeight); setVisible(true); setPosition(orgPos.x, orgPos.y); addAction(Actions.moveTo(targetPos.x, targetPos.y, .1f)); } }
@Override public void touchUp (final InputEvent event, final float x, final float y, final int pointer, final int button) { if (isDragged()) { removeBlocker(); getStageCoordinates(event); mimic.setPosition(MIMIC_COORDINATES.x, MIMIC_COORDINATES.y); if (listener == null || mimic.getActor().getStage() != null && listener.onEnd(this, mimic.getActor(), STAGE_COORDINATES.x, STAGE_COORDINATES.y)) { // Drag end approved - fading out. addMimicHidingAction(Actions.fadeOut(fadingTime, fadingInterpolation), fadingTime); } else { // Drag end cancelled - returning to the original position. addMimicHidingAction(Actions.moveTo(dragStartX, dragStartY, movingTime, movingInterpolation), movingTime); } } }