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


Java SequenceAction类代码示例

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


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

示例1: shouldParseSpriteView

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
@Test
@NeedGL
public void shouldParseSpriteView() throws Exception {
    CocoStudioUIEditor editor = new CocoStudioUIEditor(
        Gdx.files.internal("animation/MainScene.json"), null, null, null, null);

    Group group = editor.createGroup();
    Image image = group.findActor("st_2");
    Array<Action> actions = image.getActions();
    assertThat(actions.size, is(1));
    RepeatAction repeatAction = (RepeatAction) actions.get(0);
    ParallelAction parallelAction = (ParallelAction) repeatAction.getAction();
    assertThat(parallelAction.getActions().size, is(3));
    assertThat(parallelAction.getActions(), (Matcher) everyItem(instanceOf(SequenceAction.class)));
    SequenceAction moveAction = (SequenceAction) parallelAction.getActions().get(0);
    SequenceAction scaleAction = (SequenceAction) parallelAction.getActions().get(1);
    assertThat(moveAction.getActions().size, is(4));
    assertThat(moveAction.getActions(), (Matcher) everyItem(instanceOf(MoveToAction.class)));
    assertThat(scaleAction.getActions().size, is(4));
    assertThat(scaleAction.getActions(), (Matcher) everyItem(instanceOf(ScaleToAction.class)));
}
 
开发者ID:varFamily,项目名称:cocos-ui-libgdx,代码行数:22,代码来源:CCSpriteViewTest.java

示例2: addBackgroundExtension

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
private void addBackgroundExtension() {
    Image stobottom = new Image(new TextureRegion(manager.getAssetsExtension().getTexture(NameFiles.imageArrowBottom)));
    stobottom.setSize(Gdx.graphics.getWidth() * 0.1f, Gdx.graphics.getWidth() * 0.22f);
    stobottom.setPosition(Gdx.graphics.getWidth() / 2 - stobottom.getWidth() / 2, Gdx.graphics.getHeight() * 0.74f);
    Image selectroomtext = new Image(new TextureRegion(manager.getAssetsExtension().getTexture(NameFiles.txtSelectExtension)));
    selectroomtext.setSize(Gdx.graphics.getWidth() * 0.44f, Gdx.graphics.getHeight() * 0.12f);
    selectroomtext.setPosition(Gdx.graphics.getWidth() / 2 - selectroomtext.getWidth() / 2, Gdx.graphics.getHeight() * 0.815f);
    RepeatAction repeatActioan = new RepeatAction();
    MoveToAction fadedown = new MoveToAction();
    fadedown.setPosition(Gdx.graphics.getWidth() / 2 - stobottom.getWidth() / 2, Gdx.graphics.getHeight() * 0.71f);
    fadedown.setDuration(0.5f);
    MoveToAction fadeup = new MoveToAction();
    fadeup.setPosition(Gdx.graphics.getWidth() / 2 - stobottom.getWidth() / 2, Gdx.graphics.getHeight() * 0.74f);
    fadeup.setDuration(1f);
    repeatActioan.setAction(new SequenceAction(fadedown, fadeup));
    repeatActioan.setCount(RepeatAction.FOREVER);
    stobottom.addAction(repeatActioan);
    groupBtn = new Group();
    groupBtn.addActor(stobottom);
    groupBtn.addActor(selectroomtext);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:22,代码来源:ScreenExtensions.java

示例3: 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

示例4: refreshStyleProperties

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
public void refreshStyleProperties(boolean preserveScroll) {
    if (stylePropertiesTable != null && stylePropertiesScrollPane != null) {
        float scrollY;
        if (preserveScroll) {
            scrollY = stylePropertiesScrollPane.getScrollY();
        } else {
            scrollY = 0;
        }

        stylePropertiesTable.clearChildren();
        addStyleProperties(stylePropertiesTable);

        if (preserveScroll) {
            validate();
            stylePropertiesScrollPane.setSmoothScrolling(false);
            stylePropertiesScrollPane.setScrollY(scrollY);
            stylePropertiesScrollPane.addAction(new SequenceAction(new DelayAction(.1f), new Action() {
                @Override
                public boolean act(float delta) {
                    stylePropertiesScrollPane.setSmoothScrolling(true);
                    return true;
                }
            }));
        }
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:27,代码来源:RootTable.java

示例5: handle

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
public void handle(TmxMap tileMap, TmxCell collidingCell, Stage stage) {
	
	AbstractBlock block = tileMap.getBlockAt(collidingCell.getX(), collidingCell.getY());		
	if (block!=null) {
		if (block.getBlocType()==BlockTypeEnum.MYSTERY_BLOCK_INVISIBLE) {				
			block.changeFrame();
		}
		float yWallBlock = block.getY();
		SequenceAction sequenceAction = new SequenceAction(
				new ChangeCellValueAction(tileMap, (int)block.getX(), (int)yWallBlock, TileIdConstants.INVISIBLE_BLOCK),
				ActionFacade.createMoveAction(block.getX(), yWallBlock + 0.4f, 0.08f),
				ActionFacade.createMoveAction(block.getX(), yWallBlock, 0.08f),
				new ReplaceWallAction(tileMap, block));
		block.addAction(sequenceAction);		
		// Add item 
		addItemFromBlock(tileMap, stage, block);
		// Check if one or several items were over the wall
		bumpElements(tileMap, collidingCell, stage);
	} else {
		Gdx.app.log("ERROR", "Block already taken in account");
	}
	
}
 
开发者ID:provenza24,项目名称:Mario-Libgdx,代码行数:24,代码来源:MysteryBlockCollisionHandler.java

示例6: move

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
public void move(int x, int y) {
    float size = 32.0f;
    // Distance in pixels
    float dx = size * x;
    float dy = size * y;

    int destX = getPosX() + x;
    int destY = getPosY() + y;

    MoveByAction moveX = new MoveByAction();
    moveX.setAmountX(dx);
    moveX.setDuration(Math.abs(x) * 0.1f);

    MoveByAction moveY = new MoveByAction();
    moveY.setAmountY(dy);
    moveY.setDuration(Math.abs(y) * 0.1f);

    moveSeq = new SequenceAction(moveX, moveY);
    Speech.getInstance().speak("move " + this.name + " to " + getLetter(destY) + " " + (destX + 1));

    this.setPosition(destY, destX);
    this.addAction(moveSeq);

    moved = true;
    GameState.getInstance().addMove();
}
 
开发者ID:DiamondFire,项目名称:DIamondFire,代码行数:27,代码来源:Knight.java

示例7: 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

示例8: 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

示例9: 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

示例10: act

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
@Override
public void act(float delta) {
    super.act(delta);
    table.act(delta);
    switch (state) {
        case 0:
            if(!Gdx.input.isTouched())
                state++;
            break;
        case 1:
            if(Gdx.input.isTouched())
                state++;
            break;
        case 2:
            if(!Gdx.input.isTouched()) {
                AlphaAction action = new AlphaAction();
                action.setAlpha(0f);
                action.setDuration(0.3f);
                addAction(new SequenceAction(action, new RunnableAction() {
                    @Override
                    public void run() {
                        remove();
                    }
                }));
                state++;
            }
            break;
    }
}
 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:30,代码来源:MessageWindow.java

示例11: createPuls

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
public Group createPuls(float x, float y){
    grPuls = new Group();
    Texture txt = managerAssets.getAssetsTutorial().getTexture(NameFiles.circlePulsTutorial);
    Image image = new Image(new TextureRegion(txt));
    Vector2 crop = Scaling.fit.apply(txt.getWidth(),txt.getHeight(),WIDTH,HEIGHT);
    image.setSize(crop.x * 0.135f, crop.y * 0.135f);
    image.setPosition(x, y);
    grPuls.addActor(image);
    txt = managerAssets.getAssetsTutorial().getTexture(NameFiles.PulsCircleScalable);
    Image puls = new Image(new TextureRegion(txt));
    crop = Scaling.fit.apply(txt.getWidth(),txt.getHeight(),WIDTH,HEIGHT);
    puls.setPosition(image.getRight() - image.getWidth() / 2, image.getTop() - image.getHeight() / 2);
    puls.setSize(1, 1);
    MoveToAction move = new MoveToAction();
    move.setDuration(1);
    move.setPosition(image.getRight() - image.getWidth() / 2 - crop.x*0.085f, image.getTop() - image.getHeight() / 2 - crop.y*0.085f);
    MoveToAction mo = new MoveToAction();
    mo.setDuration(0);
    mo.setPosition(image.getRight() - image.getWidth() / 2, image.getTop() - image.getHeight() / 2);
    ScaleToAction scale = new ScaleToAction();
    scale.setScale(WIDTH*0.17f);
    scale.setDuration(1);
    ScaleToAction sc = new ScaleToAction();
    sc.setDuration(0);
    sc.setScale(0);
    RepeatAction repeat = new RepeatAction();
    repeat.setCount(RepeatAction.FOREVER);
    repeat.setAction(new SequenceAction(scale, sc));
    puls.addAction(repeat);
    RepeatAction r = new RepeatAction();
    r.setCount(RepeatAction.FOREVER);
    r.setAction(new SequenceAction(move, mo));
    puls.addAction(r);
    grPuls.addActor(puls);
    return grPuls;
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:37,代码来源:TutorialDialog.java

示例12: ScreenLoading

import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction; //导入依赖的package包/类
public ScreenLoading(GameManager game) {
    gameManager = game;
    assets = ManagerAssets.getInstance();
    MoveToAction mred = new MoveToAction();
    mred.setPosition(Width , -Height);
    mred.setDuration(2f);
    MoveToAction mred1 = new MoveToAction();
    mred1.setPosition(-Width , Height);
    mred1.setDuration(0);
    translatered  = new RepeatAction();
    translatered.setCount(RepeatAction.FOREVER);
    translatered.setAction(new SequenceAction(new DelayAction(0.0f), mred,mred1, new DelayAction(4.0f)));
    MoveToAction mgreen = new MoveToAction();
    mgreen.setPosition(Width , -Height );
    mgreen.setDuration(2f);
    MoveToAction mgreen1 = new MoveToAction();
    mgreen1.setPosition(-Width , Height);
    mgreen1.setDuration(0);
    translategreen = new RepeatAction();
    translategreen.setCount(RepeatAction.FOREVER);
    translategreen.setAction(new SequenceAction(new DelayAction(2.0f), mgreen,mgreen1, new DelayAction(4.0f)));
    MoveToAction mblue = new MoveToAction();
    mblue.setPosition(Width , -Height);
    mblue.setDuration(2f);
    MoveToAction mblue1 = new MoveToAction();
    mblue1.setPosition(-Width , Height);
    mblue1.setDuration(0);
    translateblue = new RepeatAction();
    translateblue.setCount(RepeatAction.FOREVER);
    translateblue.setAction(new SequenceAction(new DelayAction(4.0f), mblue,mblue1,new DelayAction(4.0f)));
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:32,代码来源:ScreenLoading.java

示例13: 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

示例14: 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

示例15: 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


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