本文整理汇总了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));
}
}
示例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);
}
})));
}
示例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())));
}
};
}
示例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));
}
}
示例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;
}
示例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;
}
示例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();
}
}));
}
示例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);
}
示例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));
}
示例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));
}
示例11: actionLoadNextChallengeQuick
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action actionLoadNextChallengeQuick() {
return Actions.sequence(Actions.delay(.1f), Actions.run(runLoadNextChallenge));
}
示例12: actionLoadNextChallengeDelayed
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private Action actionLoadNextChallengeDelayed() {
return Actions.sequence(Actions.delay(1.5f), Actions.run(runLoadNextChallenge));
}
示例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));
}
示例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));
}
示例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));
}