/** Called when tooltip is hidden. Default implementation sets actions to animate hiding and to remove the actor from the stage * when the actions are complete. A subclass must at least remove the actor. */ protected void hideAction (Tooltip tooltip) { tooltip.container .addAction(sequence(parallel(alpha(0.2f, 0.2f, fade), scaleTo(0.05f, 0.05f, 0.2f, Interpolation.fade)), removeActor())); }
/** Called when tooltip is hidden. Default implementation sets actions to animate hiding and to remove the actor from the stage * when the actions are complete. A subclass must at least remove the actor. */ protected void hideAction (Tooltip tooltip) { tooltip.container .addAction(sequence(parallel(alpha(0.2f, 0.2f, fade), scaleTo(0.05f, 0.05f, 0.2f, Interpolation.fade)), removeActor())); }
/** Called when tooltip is shown. Default implementation sets actions to animate showing. */ protected void showAction (Tooltip tooltip) { float actionTime = animations ? (time > 0 ? 0.5f : 0.15f) : 0.1f; tooltip.container.setTransform(true); tooltip.container.getColor().a = 0.2f; tooltip.container.setScale(0.05f); tooltip.container.addAction(parallel(fadeIn(actionTime, fade), scaleTo(1, 1, actionTime, Interpolation.fade))); }
/** Called when tooltip is shown. Default implementation sets actions to animate showing. */ protected void showAction (Tooltip tooltip) { float actionTime = animations ? (time > 0 ? 0.5f : 0.15f) : 0.1f; tooltip.container.setTransform(true); tooltip.container.getColor().a = 0.2f; tooltip.container.setScale(0.05f); tooltip.container.addAction(parallel(fadeIn(actionTime, fade), scaleTo(1, 1, actionTime, Interpolation.fade))); }
@Override public void create () { stage = new Stage(); Action complexAction = forever(sequence(parallel(rotateBy(180, 2), scaleTo(1.4f, 1.4f, 2), alpha(0.7f, 2)), parallel(rotateBy(180, 2), scaleTo(1.0f, 1.0f, 2), alpha(1.0f, 2)))); texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), false); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); final Image img1 = new Image(new TextureRegion(texture)); img1.setSize(100, 100); img1.setOrigin(50, 50); img1.setPosition(50, 50); final Image img2 = new Image(new TextureRegion(texture)); img2.setSize(50, 50); img2.setOrigin(50, 50); img2.setPosition(150, 150); stage.addActor(img1); stage.addActor(img2); img1.addAction(complexAction); // img2.action(complexAction.copy()); }
@Override public void create () { stage = new Stage(); texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), false); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); img = new Image(new TextureRegion(texture)); img.setSize(100, 100); img.setOrigin(50, 50); img.setPosition(100, 100); img2 = new Image(new TextureRegion(texture)); img2.setSize(100, 100); img2.setOrigin(50, 50); img2.setPosition(100, 100); img3 = new Image(new TextureRegion(texture)); img3.setSize(100, 100); img3.setOrigin(50, 50); img3.setPosition(100, 100); stage.addActor(img); stage.addActor(img2); stage.addActor(img3); img.addAction(sequence()); img2.addAction(parallel(sequence(), moveBy(100, 0, 1))); img3.addAction(sequence(parallel(moveBy(100, 200, 2)), Actions.run(this))); }
/** Called when tooltip is hidden. Default implementation sets actions to animate hiding and to remove the actor from the stage * when the actions are complete. A subclass must at least remove the actor. */ protected void hideAction (Tooltip tooltip) { tooltip.container .addAction(sequence(parallel(alpha(0.2f, 0.2f, fade), scaleTo(0.05f, 0.05f, 0.2f, Interpolation.fade)), removeActor())); }
/** Called when tooltip is shown. Default implementation sets actions to animate showing. */ protected void showAction (Tooltip tooltip) { float actionTime = animations ? (time > 0 ? 0.5f : 0.15f) : 0.1f; tooltip.container.setTransform(true); tooltip.container.getColor().a = 0.2f; tooltip.container.setScale(0.05f); tooltip.container.addAction(parallel(fadeIn(actionTime, fade), scaleTo(1, 1, actionTime, Interpolation.fade))); }
@Override public void onDragStarted(int screenX, int screenY) { eventDispatcher.postEvent(new FileDragDropEvent(FileDragDropEvent.Action.START_DRAGGING)); overlayRoot.clearActions(); overlayRoot.addAction(Actions.sequence( Actions.scaleTo(1.5f, 1.5f), Actions.visible(true), Actions.parallel( Actions.fadeIn(0.5f, Interpolation.pow5Out), Actions.scaleTo(1f, 1f, 0.5f, Interpolation.pow5Out) ) )); }
actor.addAction(Actions.forever( Actions.sequence( Actions.parallel( Actions.moveBy(0, 300, 0.5f, Interpolation.pow2Out), Actions.moveBy(200, 0, 0.5f), Actions.scaleTo(0.7f, 0.7f, 0.5f) ), Actions.parallel( Actions.moveBy(0, -300, 0.5f, Interpolation.pow2In), Actions.moveBy(200, 0, 0.5f), Actions.scaleTo(1f, 1f, 0.5f) ), Actions.parallel( Actions.moveBy(0, 300, 0.5f, Interpolation.pow2Out), Actions.moveBy(-200, 0, 0.5f), Actions.scaleTo(0.7f, 0.7f, 0.5f) ), Actions.parallel( Actions.moveBy(0, -300, 0.5f, Interpolation.pow2In), Actions.moveBy(-200, 0, 0.5f),
sequence[index++] = Actions.delay(delay); final TextCellFactory.Glyph glyph = glyph(shown, startColor, startX, startY); sequence[index++] = Actions.parallel( new TemporalAction(duration) { @Override
sequence[index++] = Actions.delay(delay); final TextCellFactory.Glyph glyph = glyph(shown, startColor, gridX(startX), gridY(startY)); sequence[index++] = Actions.parallel( new TemporalAction(duration) { @Override
@Override public void run() { final ColorChangeImage gi = textFactory.makeGlyphImage(glyph, scc.gradient(startColor, endColor, (int) (dur * 40)), dur * 1.1f, doubleWidth); gi.setPosition(adjustX(startX, doubleWidth), adjustY(startY)); gi.setRotation(startRotation); autoActors.add(gi); sequence[0] = Actions.parallel( Actions.moveTo(adjustX(endX, doubleWidth), adjustY(endY), dur), Actions.rotateTo(endRotation, dur)); sequence[1] = Actions.run(new Runnable() { @Override public void run() { recallActor(gi, false); } }); gi.addAction(Actions.sequence(sequence)); } })));
gi.setRotation(startRotation); autoActors.add(gi); sequence[0] = Actions.parallel( Actions.moveTo(adjustX(endX, doubleWidth), adjustY(endY), dur), Actions.rotateTo(endRotation, dur));
Gdx.app.log(TAG, "Parallel Action3"); myactor.clearActions(); myactor.addAction(parallel(moveTo(myactor.getX() -0.3f, myactor.getY(), 1.5f), fadeIn(1.75f))); break;