本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.actions.RunnableAction类的典型用法代码示例。如果您正苦于以下问题:Java RunnableAction类的具体用法?Java RunnableAction怎么用?Java RunnableAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RunnableAction类属于com.badlogic.gdx.scenes.scene2d.actions包,在下文中一共展示了RunnableAction类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hide
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
private void hide() {
shown = false;
hiding = true;
Gdx.input.setInputProcessor(lastInputProcessor);
addAction(Actions.sequence(
Actions.moveTo(0, Gdx.graphics.getHeight(), 0.5f, Interpolation.swingIn),
new RunnableAction() {
@Override
public void run() {
hiding = false;
}
}
));
scorer.resume();
}
示例2: e
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
public final void e()
{
if (this.e == null)
this.a = false;
while (true)
{
return;
an.b(this.f);
Table localTable = this.e;
RunnableAction localRunnableAction = new RunnableAction();
localRunnableAction.setRunnable(new y(this, localTable));
localTable.addAction(Actions.sequence(Actions.fadeOut(0.25F), localRunnableAction));
this.f = false;
Iterator localIterator = this.b.iterator();
while (localIterator.hasNext())
((aa)localIterator.next()).b();
}
}
示例3: resumeGame
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
private void resumeGame() {
pauseButton.addAction(Actions.sequence(Actions.visible(true), Actions.fadeIn(1)));
mainMenuCell.getActor().addAction(Actions.sequence(Actions.fadeOut(1), Actions.visible(false), new RunnableAction() {
@Override
public void run() {
inputHandler.onResume();
}
}));
}
示例4: act
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的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;
}
}
示例5: show
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
@Override
public Dialog show(Stage stage) {
Dialog dialog = super.show(stage);
RunnableAction runnableAction = new RunnableAction();
runnableAction.setRunnable(() -> {
if (runnable != null) {
runnable.run();
}
hide();
});
Action action = new SequenceAction(new DelayAction(.5f), runnableAction);
addAction(action);
return dialog;
}
示例6: resize
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
@Override
public void resize(int width, int height) {
stage.getViewport().update(width, height, true);
float scale = Math.min(width, height) / (logoImage.getWidth() * 1.3f);
if (scale < 1) {
logoImage.setScale(scale);
} else {
scale = 1;
}
logoImage.setPosition(width / 2 - logoImage.getWidth() / 2 * scale,
height / 2 - logoImage.getHeight() / 2 * scale);
logoImage.clearActions();
logoImage.getColor().a = 0;
logoImage.setScale(scale, 0.3f * scale);
Action act = sequence(parallel(alpha(1, 3), scaleTo(scale, scale, 2)),
delay(0.5f), parallel(alpha(0, 0.7f)), new RunnableAction() {
@Override
public void run() {
manager.showMenu();
}
});
logoImage.addAction(act);
label.getColor().a = 0;
label.setPosition(width / 2 - label.getWidth() / 2, 10);
label.addAction(sequence(alpha(0.5f, 2), alpha(0, 2)));
}
示例7: makeFlyAction
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
private Action makeFlyAction(final Image cloud) {
Action moveTo = Actions.moveTo(worldSize.x, cloud.getY(), MathUtils.random(30f, 45f));
RunnableAction finished = Actions.run(new Runnable() {
@Override
public void run() {
cloud.remove();
}
});
return Actions.sequence(Actions.fadeIn(0.15f), moveTo, finished);
}
示例8: startAction
import com.badlogic.gdx.scenes.scene2d.actions.RunnableAction; //导入依赖的package包/类
public void startAction(RunnableAction action) {
table.addAction(new SequenceAction(getDefaultHideAnimation(), action));
}