当前位置: 首页>>代码示例>>Java>>正文


Java Actions.sequence方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.actions.Actions.sequence方法的典型用法代码示例。如果您正苦于以下问题:Java Actions.sequence方法的具体用法?Java Actions.sequence怎么用?Java Actions.sequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.actions.Actions的用法示例。


在下文中一共展示了Actions.sequence方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reactOnClick

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public void reactOnClick() {
    //Action testAction = Actions.moveBy(10, 15);//sizeBy, moveBy and other action :D
    int xMoveAmount = MathUtils.random(-130, 130);

    Action moveAction = Actions.sequence(
            Actions.moveBy(xMoveAmount, 10, 0.30f, Interpolation.circleOut),
            Actions.moveBy(-xMoveAmount, -10, 0.30f, Interpolation.circle)
    );

    int yGrowAmount = MathUtils.random(-30, 100);

    Action growAction = Actions.sequence(
            Actions.sizeBy(yGrowAmount, 20, 0.2f, Interpolation.circleOut),
            Actions.sizeBy(-yGrowAmount, -20, 0.2f, Interpolation.circle)
    );

    this.addAction(moveAction);
    this.addAction(growAction);

    if(this.getHeight() > 170) {
        this.addAction(Actions.rotateBy(MathUtils.randomSign() * 360, 0.4f));
    }
}
 
开发者ID:BePeGames,项目名称:ClickerGame,代码行数:24,代码来源:Player.java

示例2: show

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
@Override
public void show(final Stage stage, final Action action) {
    bonuses.clear();
    effects.clear();
    box2d.create();
    minionSprites.clear();
    running = true;
    timer = 0f;
    background = gameAssetService.getRandomBackground();
    for (final Table table : playerViews) {
        table.setVisible(false);
    }
    createPlayerSprites();
    createBlockSprites();
    createMinionSprites();
    super.show(stage, Actions.sequence(action, Actions.run(new Runnable() {
        @Override
        public void run() { // Listening to user input events:
            final InputMultiplexer inputMultiplexer = new InputMultiplexer(stage);
            box2d.initiateControls(inputMultiplexer);
            Gdx.input.setInputProcessor(inputMultiplexer);
        }
    })));
}
 
开发者ID:BialJam,项目名称:M-M,代码行数:25,代码来源:GameController.java

示例3: getDefaultViewShowingActionProvider

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private ActionProvider getDefaultViewShowingActionProvider() {
    return new ActionProvider() {
        @Override
        public Action provideAction(final ViewController forController, final ViewController previousController) {
            if (musicService.getCurrentTheme() == null && GdxArrays.isNotEmpty(forController.getThemes())) {
                final Music currentTheme = forController.getThemes().random();
                return Actions.sequence(Actions.alpha(0f), Actions.fadeIn(DEFAULT_FADING_TIME),
                        Actions.run(CommonActionRunnables.getMusicThemeSetterRunnable(musicService, currentTheme)),
                        Actions.run(CommonActionRunnables.getInputSetterRunnable(forController.getStage())),
                        MusicFadingAction.fadeIn(currentTheme, MusicService.DEFAULT_THEME_FADING_TIME,
                                musicService.getMusicVolume()));
            }
            return Actions.sequence(Actions.alpha(0f), Actions.fadeIn(DEFAULT_FADING_TIME),
                    Actions.run(CommonActionRunnables.getInputSetterRunnable(forController.getStage())));
        }
    };
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn-mvc,代码行数:18,代码来源:InterfaceService.java

示例4: setView

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @param view will be set as the current view after view transition. Current screen (if any exists) will receive a
 *            {@link AbstractLmlView#hide()} call. The new screen will be resized using
 *            {@link AbstractLmlView#resize(int, int, boolean)} and then will receive a
 *            {@link AbstractLmlView#show()} call.
 * @param doAfterHide will be executed after the current view is fully hidden. Is never executed if there was no
 *            current view.
 * @see #getViewShowingAction(AbstractLmlView)
 * @see #getViewHidingAction(AbstractLmlView) */
public void setView(final AbstractLmlView view, final Action doAfterHide) {
    if (currentView != null) {
        viewChangeRunnable.setView(view);
        Gdx.input.setInputProcessor(null);
        currentView.hide();
        final Action hideAction = doAfterHide == null
                ? Actions.sequence(getViewHidingAction(currentView), Actions.run(viewChangeRunnable))
                : Actions.sequence(getViewHidingAction(currentView), doAfterHide, Actions.run(viewChangeRunnable));
        currentView.getStage().addAction(hideAction);
    } else {
        currentView = view;
        currentView.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), isCenteringCameraOnResize());
        Gdx.input.setInputProcessor(currentView.getStage());
        currentView.show();
        currentView.getStage().addAction(getViewShowingAction(view));
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:26,代码来源:LmlApplicationListener.java

示例5: getAlphaAction

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action getAlphaAction() {
	SequenceAction sa = Actions.sequence();
	sa.addAction(Actions.delay(1f));
	sa.addAction(Actions.alpha(1f, 4f));
	sa.addAction(Actions.delay(4f));
	sa.addAction(Actions.alpha(0f, 2f));
	sa.addAction(Actions.delay(1f));
	return sa;
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:10,代码来源:ScreenPoweredBy.java

示例6: getVolumeAction

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action getVolumeAction(Music music) {
	SequenceAction sa = Actions.sequence();
	sa.addAction(Actions.delay(1f));
	sa.addAction(new MusicVolumeAction(music, .7f, 4f));
	sa.addAction(Actions.delay(4f));
	sa.addAction(new MusicVolumeAction(music, 0f, 2f));
	sa.addAction(Actions.delay(1f));
	if (onDone != null) {
		sa.addAction(Actions.run(onDone));
	}
	return sa;
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:13,代码来源:ScreenPoweredBy.java

示例7: actionUpdateTimeLeft

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action actionUpdateTimeLeft() {
	return Actions.sequence(Actions.delay(.15f), Actions.run(new Runnable() {
		@Override
		public void run() {
			stage.addAction(actionUpdateTimeLeft());
			updateTimeleft();
		}
	}));
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:10,代码来源:LearningSession.java

示例8: Blink

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public Blink(float fadeTime, float stopTime){
    setCount(RepeatAction.FOREVER);

    Action blinkSequence = Actions.sequence(
            Actions.alpha(0, fadeTime),
            Actions.delay(stopTime),
            Actions.alpha(1, fadeTime),
            Actions.delay(stopTime));

    setAction(blinkSequence);
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:12,代码来源:Blink.java

示例9: resizeBalls

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/**
 * Resize some balls from this board.
 *
 * @param bounds bounding box for the balls that will be resized.
 * @param scale  the final scale for these balls.
 * @param time   the time that the animation will last for
 * @return the action that will animate these balls
 */
private Action resizeBalls(final Bounds bounds, final float scale, final float time) {
    Action scalingAction = Actions.run(new Runnable() {
        @Override
        public void run() {
            for (int x = bounds.minX; x <= bounds.maxX; x++) {
                for (int y = bounds.minY; y <= bounds.maxY; y++) {
                    BallActor scaledBall = actors[x][y];
                    scaledBall.addAction(Actions.scaleTo(scale, scale, time));
                }
            }
        }
    });
    return Actions.sequence(scalingAction, Actions.delay(time));
}
 
开发者ID:danirod,项目名称:rectball,代码行数:23,代码来源:BoardActor.java

示例10: shake

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public Action shake(final Bounds region, final float shakiness, final int times, final float speed) {
    Action shakingAction = Actions.run(new Runnable() {
        @Override
        public void run() {
            for (int y = region.minY; y <= region.maxY; y++)
                for (int x = region.minX; x <= region.maxX; x++)
                    actors[x][y].addAction(Actions.repeat(times, Actions.sequence(
                                                                                         Actions.moveBy(shakiness / 2, 0, speed / 2),
                                                                                         Actions.moveBy(-shakiness, 0, speed),
                                                                                         Actions.moveBy(shakiness / 2, 0, speed / 2)
                    )));
        }
    });
    return Actions.sequence(shakingAction, Actions.delay(times * speed));
}
 
开发者ID:danirod,项目名称:rectball,代码行数:16,代码来源:BoardActor.java

示例11: actionLoadNextChallengeQuick

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action actionLoadNextChallengeQuick() {
	return Actions.sequence(Actions.delay(.1f), Actions.run(runLoadNextChallenge));
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:4,代码来源:LearningSession.java

示例12: actionLoadNextChallengeDelayed

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action actionLoadNextChallengeDelayed() {
	return Actions.sequence(Actions.delay(1.5f), Actions.run(runLoadNextChallenge));
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:4,代码来源:LearningSession.java

示例13: pulse

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** Pulses the actor down on a touch
 * @param actor some {@link Actor}. Be sure it is transformable. */
public static Action pulse(Actor actor) {
	actor.setOrigin(actor.getWidth() / 2, actor.getHeight() / 2);
	return Actions.sequence(Actions.scaleTo(0.8f, 0.8f, 0.1f, Interpolation.pow2Out), Actions.scaleTo(1.2f, 1.2f, 0.08f, Interpolation.pow2Out), Actions.scaleTo(1f, 1f, 0.05f, Interpolation.pow2Out));
}
 
开发者ID:adketuri,项目名称:umbracraft,代码行数:7,代码来源:WidgetUtils.java

示例14: fadeIn

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @return action that sets the action invisible and slowly fades it in. */
public Action fadeIn() {
    // Used by main window just after view show.
    return Actions.sequence(Actions.alpha(0f), Actions.fadeIn(0.5f, Interpolation.fade));
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:6,代码来源:MainView.java

示例15: getTabShowingAction

import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @return simple fading in action. */
@LmlAction("showTab")
public Action getTabShowingAction() {
    return Actions.sequence(Actions.alpha(0f), Actions.fadeIn(0.1f));
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:6,代码来源:MainView.java


注:本文中的com.badlogic.gdx.scenes.scene2d.actions.Actions.sequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。