public void changed (ChangeEvent event, Actor actor) { stage.addAction(Actions.sequence(Actions.delay(2), Actions.run(new Runnable(){ public void run () { nextColor(); Gdx.app.log(str4, "RunnableAction executed"); } }))); }}); root.add(button4).row();
protected void onHide (Actor selectBoxList) { selectBoxList.getColor().a = 1; selectBoxList.addAction(sequence(fadeOut(0.15f, Interpolation.fade), removeActor())); }
protected void onHide (Actor selectBoxList) { selectBoxList.getColor().a = 1; selectBoxList.addAction(sequence(fadeOut(0.15f, Interpolation.fade), removeActor())); }
/** Centers the dialog in the stage and calls {@link #show(Stage, Action)} with a {@link Actions#fadeIn(float, Interpolation)} * action. */ public Dialog show (Stage stage) { show(stage, sequence(Actions.alpha(0), Actions.fadeIn(0.4f, Interpolation.fade))); setPosition(Math.round((stage.getWidth() - getWidth()) / 2), Math.round((stage.getHeight() - getHeight()) / 2)); return this; }
/** Centers the dialog in the stage and calls {@link #show(Stage, Action)} with a {@link Actions#fadeIn(float, Interpolation)} * action. */ public Dialog show (Stage stage) { show(stage, sequence(Actions.alpha(0), Actions.fadeIn(0.4f, Interpolation.fade))); setPosition(Math.round((stage.getWidth() - getWidth()) / 2), Math.round((stage.getHeight() - getHeight()) / 2)); return 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 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())); }
@Override public void create () { texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); stage = new Stage(); for (int i = 0; i < 100; i++) { Image img = new Image(new TextureRegion(texture)); img.setX((float)Math.random() * 480); img.setY((float)Math.random() * 320); img.getColor().a = (float)Math.random() * 0.5f + 0.5f; stage.addActor(img); } stage.getRoot().addAction(forever(sequence(fadeOut(3), fadeIn(3)))); }
@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))); }
/** Removes the dialog from the stage, restoring the previous keyboard and scroll focus, and adds the specified action to the * dialog. * @param action If null, the dialog is removed immediately. Otherwise, the dialog is removed when the action completes. The * dialog will not respond to touch down events during the action. */ public void hide (Action action) { Stage stage = getStage(); if (stage != null) { removeListener(focusListener); if (previousKeyboardFocus != null && previousKeyboardFocus.getStage() == null) previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setKeyboardFocus(previousKeyboardFocus); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setScrollFocus(previousScrollFocus); } if (action != null) { addCaptureListener(ignoreTouchDown); addAction(sequence(action, Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); } else remove(); }
/** Removes the dialog from the stage, restoring the previous keyboard and scroll focus, and adds the specified action to the * dialog. * @param action If null, the dialog is removed immediately. Otherwise, the dialog is removed when the action completes. The * dialog will not respond to touch down events during the action. */ public void hide (Action action) { Stage stage = getStage(); if (stage != null) { removeListener(focusListener); if (previousKeyboardFocus != null && previousKeyboardFocus.getStage() == null) previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setKeyboardFocus(previousKeyboardFocus); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setScrollFocus(previousScrollFocus); } if (action != null) { addCaptureListener(ignoreTouchDown); addAction(sequence(action, Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); } else remove(); }
@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()); }
actor.addAction(forever(sequence(moveBy(50, 0, 2), moveBy(-50, 0, 2), run(new Runnable() { public void run () { actor.setZIndex(0);
@Override public Action provideAction(final ViewController forController, final ViewController connectedView) { return Actions.sequence( Actions.run(new Runnable() { @Override public void run() { App.inst().getInput().removeProcessor(forController.getStage()); } }), Actions.fadeOut(InterfaceService.DEFAULT_FADING_TIME)); } });
/** * Hides the dialog. Called automatically when a button is clicked. The default implementation fades out the dialog over 400 * milliseconds and then removes it from the stage. */ public void hide () { hide(sequence(Actions.fadeOut(FADE_TIME, Interpolation.fade), Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); }
private VisTable fadeIn () { clearActions(); setColor(1, 1, 1, 0); addAction(Actions.sequence(Actions.fadeIn(fadeTime, Interpolation.fade))); return this; }
/** {@link #pack() Packs} the dialog and adds it to the stage, centered with default fadeIn action */ public VisDialog show (Stage stage) { show(stage, sequence(Actions.alpha(0), Actions.fadeIn(0.4f, Interpolation.fade))); setPosition(Math.round((stage.getWidth() - getWidth()) / 2), Math.round((stage.getHeight() - getHeight()) / 2)); return this; }
/** Centers the dialog in the stage and calls {@link #show(Stage, Action)} with a {@link Actions#fadeIn(float, Interpolation)} * action. */ public Dialog show (Stage stage) { show(stage, sequence(Actions.alpha(0), Actions.fadeIn(0.4f, Interpolation.fade))); setPosition(Math.round((stage.getWidth() - getWidth()) / 2), Math.round((stage.getHeight() - getHeight()) / 2)); return 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())); }
@Override public void onDragFinished() { eventDispatcher.postEvent(new FileDragDropEvent(FileDragDropEvent.Action.STOP_DRAGGING)); overlayRoot.clearActions(); overlayRoot.addAction(Actions.sequence( Actions.fadeOut(0.35f), Actions.visible(false) )); }