當前位置: 首頁>>代碼示例>>Java>>正文


Java Actions.action方法代碼示例

本文整理匯總了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);
}
 
開發者ID:polyrob,項目名稱:QuickFlix,代碼行數:20,代碼來源:MenuScene.java

示例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;
}
 
開發者ID:polyrob,項目名稱:QuickFlix,代碼行數:22,代碼來源:MenuScene.java

示例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;
}
 
開發者ID:polyrob,項目名稱:QuickFlix,代碼行數:21,代碼來源:MenuScene.java

示例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);   
}
 
開發者ID:rincewindcz,項目名稱:LiftOffGame,代碼行數:8,代碼來源:GameScreen.java

示例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);
}
 
開發者ID:rincewindcz,項目名稱:LiftOffGame,代碼行數:12,代碼來源:GameScreen.java

示例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);
}
 
開發者ID:rincewindcz,項目名稱:LiftOffGame,代碼行數:13,代碼來源:GameScreen.java

示例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;
}
 
開發者ID:gdx-libs,項目名稱:gdx-autumn-mvc,代碼行數:11,代碼來源:MusicFadingAction.java

示例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;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:17,代碼來源:VolumeAction.java

示例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;
}
 
開發者ID:Mignet,項目名稱:Inspiration,代碼行數:7,代碼來源:ScreenTransitionAction.java

示例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;
}
 
開發者ID:crashinvaders,項目名稱:gdx-texture-packer-gui,代碼行數:7,代碼來源:PostAction.java

示例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;
}
 
開發者ID:gdx-libs,項目名稱:gdx-autumn-mvc,代碼行數:9,代碼來源:MusicFadingAction.java

示例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;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:8,代碼來源:MusicStopAction.java


注:本文中的com.badlogic.gdx.scenes.scene2d.actions.Actions.action方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。