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


Java SequenceAction.addAction方法代码示例

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


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

示例1: setUpSkinImages

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
public void setUpSkinImages() {
    skinImage = new Image(skins.get(position).getTextureRegion());
    skinImageRotation = new Image(skins.get(position).getTextureRegion());

    skinImage.setSize(3f, 3f);
    skinImage.setOrigin(skinImage.getWidth() / 2, skinImage.getHeight() / 2);
    skinImage.setPosition(Constants.WIDTH / 3 - skinImage.getWidth() / 2, Constants.HEIGHT / 2);

    skinImageRotation.setSize(3f, 3f);
    skinImageRotation.setOrigin(skinImageRotation.getWidth() / 2, skinImageRotation.getHeight() / 2);
    skinImageRotation.setPosition(Constants.WIDTH * 2 / 3 - skinImageRotation.getWidth() / 2, Constants.HEIGHT / 2);

    SequenceAction rotateAction = new SequenceAction();
    rotateAction.addAction(Actions.rotateBy(360, 0.5f, Interpolation.linear));
    RepeatAction infiniteLoop = new RepeatAction();
    infiniteLoop.setCount(RepeatAction.FOREVER);
    infiniteLoop.setAction(rotateAction);

    skinImageRotation.addAction(infiniteLoop);
    stage.addActor(skinImageRotation);
    stage.addActor(skinImage);
}
 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:23,代码来源:MarketScreen.java

示例2: zoomCard

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
@Override
public void zoomCard(final CardViewSmall cardView) {
	if (this.cardZoomedIn) {
		return;
	}
	final CardViewSmall cardViewCopy = new CardViewSmall(this.context, cardView.cardInfo, this, true);
	cardViewCopy.getActor().setPosition(Gdx.graphics.getWidth()/2.7f, Gdx.graphics.getHeight()/30);
	this.context.getStage().addActor(cardViewCopy.getActor());
	this.initialCardViewWidth = cardView.getActor().getWidth();
	this.initialCardViewHeight = cardView.getActor().getHeight();
	SequenceAction sequence = new SequenceAction();
	Runnable adjustForZoom = new Runnable() {
	    @Override
	    public void run() {
	    	cardViewCopy.zoom();
	    }
	};
	sequence.addAction(Actions.sizeTo(Gdx.graphics.getWidth()/4, Gdx.graphics.getHeight()*0.9f, 0.2f));
	sequence.addAction(Actions.run(adjustForZoom));		
	cardViewCopy.getActor().addAction(sequence);
	this.cardZoomedIn = true;
}
 
开发者ID:Cardshifter,项目名称:Cardshifter,代码行数:23,代码来源:DefaultZoneView.java

示例3: zoomCard

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
@Override
public void zoomCard(final CardViewSmall cardView) {
	if (this.cardZoomedIn) {
		return;
	}
	final CardViewSmall cardViewCopy = new CardViewSmall(this.context, cardView.cardInfo, this, true);
	cardViewCopy.setTargetable(TargetStatus.TARGETABLE, this);
	cardViewCopy.getActor().setPosition(this.screenWidth/2.7f, this.screenHeight/30);
	this.game.stage.addActor(cardViewCopy.getActor());
	this.initialCardViewWidth = cardView.getActor().getWidth();
	this.initialCardViewHeight = cardView.getActor().getHeight();
	SequenceAction sequence = new SequenceAction();
	Runnable adjustForZoom = new Runnable() {
	    @Override
	    public void run() {
	    	cardViewCopy.zoom();
	    }
	};
	sequence.addAction(Actions.sizeTo(this.screenWidth/4, this.screenHeight*0.9f, 0.2f));
	sequence.addAction(Actions.run(adjustForZoom));		
	cardViewCopy.getActor().addAction(sequence);
	this.cardZoomedIn = true;
}
 
开发者ID:Cardshifter,项目名称:Cardshifter,代码行数:24,代码来源:DeckBuilderScreen.java

示例4: createActions

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
private void createActions() {
    SequenceAction troopSequence = new SequenceAction();
    SequenceAction labelSequence = new SequenceAction();

    Vector2 centered = centered(path.get(0));
    setPosition(centered.x, centered.y);
    label.setPosition(centered.x, centered.y);

    for (int i = 0; i < path.getCount() - 1; i++) {
        Tile next = path.get(i + 1);
        centered = centered(next);

        troopSequence.addAction(Actions.rotateTo(angleToNext(i)));
        troopSequence.addAction(Actions.moveTo(centered.x, centered.y, speed(path.get(i), next), Interpolation.linear));
        labelSequence.addAction(Actions.moveTo(centered.x, centered.y, speed(path.get(i), next), Interpolation.linear));
    }

    troopSequence.addAction(Actions.run(() -> {
        Tile last = path.get(path.getCount() - 1);
        if (last.getOwner() == path.get(0).getOwner()) {
            last.adjustTroops(troops);
            Match.client.send(last);
        } else {
            new Battle(last, path.get(path.getCount() - 2), this);
        }
    }));
    troopSequence.addAction(Actions.removeActor());
    labelSequence.addAction(Actions.removeActor());

    addAction(troopSequence);
    label.addAction(labelSequence);
}
 
开发者ID:conquest,项目名称:conquest,代码行数:33,代码来源:Troop.java

示例5: spinnerRotateAction

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
private void spinnerRotateAction() {
    SequenceAction rotateAction = new SequenceAction();
    rotateAction.addAction(Actions.rotateBy(360, 0.5f, Interpolation.linear));
    RepeatAction infiniteLoop = new RepeatAction();
    infiniteLoop.setCount(RepeatAction.FOREVER);
    infiniteLoop.setAction(rotateAction);
    this.addAction(infiniteLoop);
}
 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:9,代码来源:Spinner.java

示例6: setOnStateImageAction

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
public RepeatAction setOnStateImageAction(float duration) {
    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(Actions.scaleTo(1.3f, 1.3f, duration));
    sequenceAction.addAction(Actions.scaleTo(1f, 1f, duration));
    RepeatAction infiniteLoop = new RepeatAction();
    infiniteLoop.setCount(RepeatAction.FOREVER);
    infiniteLoop.setAction(sequenceAction);
    return infiniteLoop;
}
 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:10,代码来源:GameScreen.java

示例7: getAlphaAction

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的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

示例8: getVolumeAction

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的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

示例9: switchScreen

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
public void switchScreen(final Game game, final Screen newScreen, Stage stage){
    stage.getRoot().getColor().a = 1;
    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(fadeOut(0.5f));
    sequenceAction.addAction(run(new Runnable() {
        @Override
        public void run() {
            game.setScreen(newScreen);
        }
    }));
    stage.getRoot().addAction(sequenceAction);
}
 
开发者ID:polyrob,项目名称:QuickFlix,代码行数:13,代码来源:BaseScene.java

示例10: Tutorial

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
public Tutorial(Rectangle bounds, String assetsId, String text) {
    this.bounds = bounds;
    this.text = text;
    textureRegion = AssetsManager.getTextureRegion(assetsId);
    SequenceAction sequenceAction = new SequenceAction();
    sequenceAction.addAction(Actions.delay(4f));
    sequenceAction.addAction(Actions.removeActor());
    addAction(sequenceAction);
    font = AssetsManager.getSmallestFont();
    setWidth(bounds.width);
    setHeight(bounds.height);
}
 
开发者ID:wmora,项目名称:martianrun,代码行数:13,代码来源:Tutorial.java

示例11: hide

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
@Override
public void hide(Runnable runnable) {
	colorPicker.setUpPickedColor();
	SequenceAction hideAction = getHideAction(runnable);
	hideAction.addAction(Actions.run(colorPicker.getReleaseResources()));
	addAction(hideAction);
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:8,代码来源:TextEditor.java

示例12: getHideAction

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
protected SequenceAction getHideAction(Runnable runnable) {
	SequenceAction preHide = Actions.sequence();
	for (Runnable r : hideRunnables) {
		preHide.addAction(Actions.run(r));
	}
	SequenceAction hide = Actions.sequence(Actions.parallel(Actions
			.fadeOut(FADE, Interpolation.fade), Actions.moveBy(0f,
			getHeight() * HIDE_OFFSET, FADE, Interpolation.exp5Out)));

	if (runnable != null) {
		hide.addAction(Actions.run(runnable));
	}
	preHide.addAction(hide);
	return preHide;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:16,代码来源:ContextMenu.java

示例13: changeGameState

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
public void changeGameState(GameState state) {
    switch (state) {
        case RESUME:
            this.state = GameState.RESUME;
            onPause.setVisible(false);
            onResume.setVisible(true);
            pauseButton.setVisible(true);
            break;
        case RUN:
            onResume.setVisible(false);
            this.state = GameState.RUN;
            isFirstClick = false;
            break;
        case PAUSE:
            this.state = GameState.PAUSE;
            onPause.setVisible(true);
            onResume.setVisible(false);
            break;
        case FINISH:
            audioManager.playSound(audioManager.getGameoverSound());
            onFinish.setVisible(true);
            pauseButton.setVisible(false);
            playButton.setVisible(true);
            if (!isRelife) {
                videoButton.setVisible(true);
                bonusLabel.setVisible(true);
            }
            homeButton.setVisible(true);
            moneyLabel.setText(" " + SCORE);
            moneyLabel.setVisible(true);
            moneyImage.setVisible(true);
            moneyImage.setX(moneyLabel.getX() + moneyLabel.getText().length + 0.7f);
            moneyImage.addAction(Actions.rotateBy(22.5f));
            SequenceAction sequenceAction = new SequenceAction();
            sequenceAction.addAction(Actions.rotateBy(-45, 0.4f, Interpolation.linear));
            sequenceAction.addAction(Actions.rotateBy(45, 0.4f, Interpolation.linear));
            RepeatAction infiniteLoop = new RepeatAction();
            infiniteLoop.setCount(RepeatAction.FOREVER);
            infiniteLoop.setAction(sequenceAction);
            moneyImage.addAction(infiniteLoop);
            if (SCORE > preferences.getMaxScore()) {
                scoreLabel.setText(" New record! \n" + "Score:" + SCORE);
            } else {
                scoreLabel.setText("Score:" + SCORE + '\n' + "Best:" + preferences.getMaxScore());
            }
            FlappySpinner.gameManager.submitScore(SCORE);
            preferences.setMaxScore(SCORE);
            scoreLabel.addAction(Actions.moveTo(Constants.WIDTH / 3 - 1 + scoreLabel.getWidth() / 2, onFinish.getY() + onFinish.getHeight() * 1.3f + 0.1f, 0.6f, Interpolation.linear));
            preferences.setUserMoney(preferences.getUserMoney() + SCORE);
            break;
    }
}
 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:53,代码来源:GameScreen.java

示例14: moveWall

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入方法依赖的package包/类
private void moveWall(TmxMap tileMap, TmxCell collidingCell, Stage stage, WallBlock specialWallBlock) {
	
	AbstractBlock wallBlock = new WallBlock(collidingCell.getX(), collidingCell.getY(),collidingCell.getCell().getTile().getId(), tileMap.getWorldType());		
	tileMap.getBlocks().add(wallBlock);
	stage.addActor(wallBlock);
	float yWallBlock = wallBlock.getY();
	ChangeCellValueAction changeCellValueAction = new ChangeCellValueAction(tileMap, collidingCell.getX(), collidingCell.getY(), TileIdConstants.INVISIBLE_BLOCK);
	Action moveUpAction1 = ActionFacade.createMoveAction(wallBlock.getX(), yWallBlock + 0.1f, 0f);
	Action moveUpAction2 = ActionFacade.createMoveAction(wallBlock.getX(), yWallBlock + 0.4f, 0.08f);
	Action moveDownAction = ActionFacade.createMoveAction(wallBlock.getX(), yWallBlock, 0.08f);
	
	int replacingTileValue = wallBlock.getTileId();
	
	if (specialWallBlock!=null) {
							
		if (specialWallBlock.getItemEnum()==ItemEnum.COINS_10 && specialWallBlock.getCoins() > 0 ) {				
			GameManager.getGameManager().addCoin();
			specialWallBlock.removeCoin();				
			AbstractSfxSprite sprite = new EjectedCoin(specialWallBlock.getX(), specialWallBlock.getY()+1);									
			tileMap.getSfxSprites().add(sprite);
			stage.addActor(sprite);				   				
			sprite.addAppearAction();		
			if (specialWallBlock.getCoins()==0) {
				replacingTileValue = specialWallBlock.getReplacingTileValue();
			}											
			SoundManager.getSoundManager().playSound(SoundManager.SOUND_COIN);
		} else {
			super.addItemFromBlock(tileMap, stage, specialWallBlock);
			replacingTileValue = specialWallBlock.getReplacingTileValue();
		}			
					
	}
	
	ChangeCellValueAction changeCellValueAction2 = new ChangeCellValueAction(tileMap, collidingCell.getX(), collidingCell.getY(), replacingTileValue);
	DeleteBlocSpriteAction deleteWallAction = new DeleteBlocSpriteAction(wallBlock);
	SequenceAction sequenceAction = new SequenceAction(moveUpAction1, changeCellValueAction, moveUpAction2, moveDownAction);
	sequenceAction.addAction(changeCellValueAction2);
	sequenceAction.addAction(moveUpAction1);
	sequenceAction.addAction(deleteWallAction);
	wallBlock.addAction(sequenceAction);		
	SoundManager.getSoundManager().playSound(SoundManager.SOUND_BUMP);		
}
 
开发者ID:provenza24,项目名称:Mario-Libgdx,代码行数:43,代码来源:WallCollisionHandler.java


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