本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.actions.Actions.action方法的典型用法代码示例。如果您正苦于以下问题:Java Actions.action方法的具体用法?Java Actions.action怎么用?Java Actions.action使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.actions.Actions
的用法示例。
在下文中一共展示了Actions.action方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
@Override
public void show() {
title.setPosition(game.SCREEN_WIDTH / 2 - title.getWidth() / 2, 800);
//helpTip.setPosition(400-helpTip.getWidth()/2, 30);
MoveToAction actionMove = Actions.action(MoveToAction.class);
actionMove.setPosition(game.SCREEN_WIDTH / 2 - title.getWidth() / 2, 380);
actionMove.setDuration(1);
actionMove.setInterpolation(Interpolation.elasticOut);
title.addAction(actionMove);
if (!music.isPlaying()) {
music = Assets.getManager().get("snd/menu_music.mp3", Music.class);
music.play();
}
showMenu(true);
}
示例2: showMenu
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private void showMenu(boolean flag) {
MoveToAction actionMove1 = Actions.action(MoveToAction.class);//out
actionMove1.setPosition(game.SCREEN_WIDTH / 2, -200);
actionMove1.setDuration(1);
actionMove1.setInterpolation(Interpolation.swingIn);
MoveToAction actionMove2 = Actions.action(MoveToAction.class);//in
actionMove2.setPosition(game.SCREEN_WIDTH / 2, 190);
actionMove2.setDuration(1f);
actionMove2.setInterpolation(Interpolation.swing);
if (flag) {
table.addAction(actionMove2);
options.addAction(actionMove1);
} else {
options.addAction(actionMove2);
table.addAction(actionMove1);
}
menuShown = flag;
exitShown = false;
}
示例3: showExit
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
private void showExit(boolean flag) {
MoveToAction actionMove1 = Actions.action(MoveToAction.class);//out
actionMove1.setPosition(game.SCREEN_WIDTH / 2, -200);
actionMove1.setDuration(1);
actionMove1.setInterpolation(Interpolation.swingIn);
MoveToAction actionMove2 = Actions.action(MoveToAction.class);//in
actionMove2.setPosition(game.SCREEN_WIDTH / 2, 190);
actionMove2.setDuration(1f);
actionMove2.setInterpolation(Interpolation.swing);
if (flag) {
exit.addAction(actionMove2);
table.addAction(actionMove1);
} else {
table.addAction(actionMove2);
exit.addAction(actionMove1);
}
exitShown = flag;
}
示例4: rocketEngineAnimation
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public void rocketEngineAnimation(){
MoveToAction action = Actions.action(MoveToAction.class);
action.setPosition(game.rocket.getX(), 60);
action.setInterpolation(Interpolation.swingIn);
action.setDuration(0.8f);
game.rocket.addAction(action);
}
示例5: rocketCrashAnimation
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public void rocketCrashAnimation() {
MoveToAction action = Actions.action(MoveToAction.class);
action.setPosition(420, 0);
action.setDuration(1f);
game.rocket.addAction(action);
RotateToAction action2 = Actions.action(RotateToAction.class);
action2.setRotation(-180f);
action2.setDuration(1f);
game.rocket.addAction(action2);
}
示例6: rocketPlatformOnAnimation
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public void rocketPlatformOnAnimation(){
MoveToAction action = Actions.action(MoveToAction.class);
action.setPosition(-100, 100);
action.setDuration(1f);
game.platform.addAction(action);
AlphaAction action6 = Actions.action(AlphaAction.class);
// action6.setRotation(90f);
action6.setColor(Color.CLEAR);
action6.setDuration(1f);
game.platform.addAction(action6);
}
示例7: fadeIn
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @param music volume will be set to zero and slowly faded in to the target.
* @param time fading duration.
* @param volume volume target.
* @return action that fades in the music. */
public static Action fadeIn(final Music music, final float time, final float volume) {
final MusicFadingAction action = Actions.action(MusicFadingAction.class);
music.setVolume(0f);
action.setData(music, time, volume);
return action;
}
示例8: setVolume
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @param music its volume will be modified.
* @param from starting volume value.
* @param to target volume value.
* @param duration length of the transition.
* @param interpolation decides how the volume is changed in time.
* @return {@link VolumeAction} instance which should be added to a stage. */
public static VolumeAction setVolume(final Music music, final float from, final float to, final float duration,
final Interpolation interpolation) {
final VolumeAction action = Actions.action(VolumeAction.class);
action.start = from;
action.end = to;
action.music = music;
action.setDuration(duration);
action.setInterpolation(interpolation);
return action;
}
示例9: transition
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public static ScreenTransitionAction transition (ScreenTransitionType type, float duration) {
ScreenTransitionAction action = Actions.action(ScreenTransitionAction.class);
action.setTransitionType(type);
action.setTransitionDuration(duration);
return action;
}
示例10: create
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
public static PostAction create(int skipFrames, Action action) {
PostAction postAction = Actions.action(PostAction.class);
postAction.setAction(action);
postAction.framesLeft = skipFrames;
return postAction;
}
示例11: fadeOut
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @param music volume will be slowly faded to 0.
* @param time fading duration.
* @return action that fades out the music. */
public static Action fadeOut(final Music music, final float time) {
final MusicFadingAction action = Actions.action(MusicFadingAction.class);
action.setData(music, time, 0f);
return action;
}
示例12: stop
import com.badlogic.gdx.scenes.scene2d.actions.Actions; //导入方法依赖的package包/类
/** @param music will be stopped.
* @return a {@link MusicStopAction} instance, which will stop the theme once executed. */
public static MusicStopAction stop(final Music music) {
final MusicStopAction action = Actions.action(MusicStopAction.class);
action.music = music;
return action;
}