• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RepeatAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: shouldParseSpriteView

import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction; //导入依赖的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.RepeatAction; //导入依赖的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.RepeatAction; //导入依赖的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: createPuls

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


示例5: ScreenLoading

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


示例6: spinnerRotateAction

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


示例7: setOnStateImageAction

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


示例8: Blink

import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction; //导入依赖的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);
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:12,代码来源:Blink.java


示例9: EngineThinkingImage

import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction; //导入依赖的package包/类
/**
 * A spinning icon that tells the user the engine is currently processing
 * the next move.
 * 
 * @param skin
 */
public EngineThinkingImage(Skin skin) {
	super(skin, MenuSkin.IMG_LOADING_ICON);
	RepeatAction mSpinAction = new RepeatAction();
	mSpinAction.setCount(RepeatAction.FOREVER);
	mSpinAction.setAction(Actions.rotateBy(-360.0f, 1.0f));

	setOrigin(getWidth() / 2, getHeight() / 2);
	addAction(mSpinAction);

	setVisible(false);
}
 
开发者ID:nkarasch,项目名称:ChessGDX,代码行数:18,代码来源:EngineThinkingImage.java


示例10: changeGameState

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FuncPosition类代码示例发布时间:2022-05-23
下一篇:
Java TWSDLExtension类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap