@Override public void run() { target.act(timeDelta); } });
public TypedGdxQuery<T> act(float time){ t.act(time); return this; }
public void act(float deltaTime) { if (!isStop) { super.act(deltaTime); stateTime += deltaTime; } }
@Override public void act(float delta) { super.act(delta); }
Actor some_actor = Actor.Create(Actor.Type.VOICE); some_actor.act();
@Override public void act(float delta) { super.act(delta); stateTime += delta; // Update time (1 second tick) // ############################################################ if (System.nanoTime() - startTime >= 1000000000) { secondsTime++; startTime = System.nanoTime(); } }
public GdxQuery act(float time){ for(Actor actor:list()) actor.act(time); return this; }
public TypedGdxQuery<T> stopActions(){ while(t.hasActions()) t.act(Gdx.graphics.getDeltaTime()); return this; }
private Actor actionManager = new Actor(); //use a Stage instead if using one anyway private final Color fadeColor = new Color (); private static final Color FADED = new Color(1,1,1,0); private void fadeOut (float duration){ ColorAction colorAction = Actions.color(FADED, duration, Interpolation.sine); colorAction.setColor(fadeColor); actionManager.addAction(colorAction); } private void fadeIn (float duration){ ColorAction colorAction = Actions.color(Color.WHITE, duration, Interpolation.sine); colorAction.setColor(fadeColor); actionManager.addAction(colorAction); } public void render (){ //... actionManager.act(Gdx.graphics.getDeltaTime()); batch.setColor(fadeColor); //... }
public GdxQuery stopActions(){ for(Actor t: list()) while(t.hasActions()) t.act(Gdx.graphics.getDeltaTime()); return this; }
public void act() { proxy.act(Gdx.graphics.getDeltaTime()); music.setVolume(proxy.getColor().a * Game.setting.volume * Game.setting.musicVolume); }
@Override public void act(float delta) { super.act(delta); if (body.getUserData() != null) { updateRectangle(); } else { // This means the world destroyed the body (enemy or runner went out of bounds) remove(); } }
@Override public void act(float delta) { super.act(delta); if (getStage().getActors().get(getStage().getActors().size - 1) != this) toFront(); }
@Override public void act(float delta) { super.act(delta); PageGroup pp = PageGroup.this; Vector2 pointerPos = pp.screenToLocal(Gdx.input.getX(), Gdx.input.getY()); boolean withinPage = tmpBounds.set(0f, 0f, pp.getWidth(), pp.getHeight()).contains(pointerPos); if (!withinPage && active) { clearSpotlight(); } if (withinPage) { RegionModel region = hitRegion(pointerPos); if (region != null) { spotlightRegion(region); } if (region == null && active) { clearSpotlight(); } } }
@EventHandler public void key(KeyReleaseEvent event) { switch (event.getKey()) { case MOVE_DOWN: index--; if (index < 0) index = getActors().size - 1; break; case MOVE_UP: index++; if (index >= getActors().size) index = 0; break; case USE: Actor actor_u = getActors().get(index); if (actor_u != null) actor_u.act(Gdx.graphics.getDeltaTime()); break; case BACK: if (!(SceneManager.getCurrent() instanceof TitleScreen)){ SceneManager.exit(); } break; default: // Nothing to do here } update(false); }
super.render(); fadeActor.act(Gdx.graphics.getDeltaTime()); float alpha = fadeActor.getColor().a; if (alpha != 0){