public void changed (ChangeEvent event, Actor actor) { Timer.schedule(new Task(){ public void run () { nextColor(); Gdx.app.postRunnable(new Runnable(){ public void run () { Gdx.app.log(str3, "Posted runnable to Gdx.app"); } }); }}, 2f); }}); root.add(button3).row();
@Override public void create () { Timer timer = new Timer(); Task task = timer.scheduleTask(new Task() { @Override public void run () { Gdx.app.log("TimerTest", "ping"); } }, 1, 1); Gdx.app.log("TimerTest","is task scheduled: "+String.valueOf(task.isScheduled())); } }
public Timer () { start(); }
/** Schedules a task on {@link #instance}. * @see #scheduleTask(Task, float, float) */ static public Task schedule (Task task, float delaySeconds, float intervalSeconds) { return instance().scheduleTask(task, delaySeconds, intervalSeconds); }
/** Timer instance singleton for general application wide usage. Static methods on {@link Timer} make convenient use of this * instance. */ static public Timer instance () { synchronized (threadLock) { TimerThread thread = thread(); if (thread.instance == null) thread.instance = new Timer(); return thread.instance; } }
/** Schedules a task to occur once after the specified delay. */ public Task scheduleTask (Task task, float delaySeconds) { return scheduleTask(task, delaySeconds, 0, 0); }
}; timer = new Timer(); timer.scheduleTask(new Timer.Task() { public void run() { if (activePiece == null || !movePiece(activePiece, 0, -scale)) { timer.start();
public AbstractGameManager(Stage stage, AbstractScreen screen) { this.stage = stage; this.screen = screen; random = new Random(); timer = new Timer(); }
public void resume () { synchronized (threadLock) { long delayMillis = System.nanoTime() / 1000000 - pauseMillis; for (int i = 0, n = instances.size; i < n; i++) instances.get(i).delay(delayMillis); pauseMillis = 0; threadLock.notifyAll(); } }
/** Schedules a task on {@link #instance}. * @see #scheduleTask(Task, float) */ static public Task schedule (Task task, float delaySeconds) { return instance().scheduleTask(task, delaySeconds); }
/** Schedules a task to occur once as soon as possible, but not sooner than the start of the next frame. */ public Task postTask (Task task) { return scheduleTask(task, 0, 0, 0); }
/** Timer instance singleton for general application wide usage. Static methods on {@link Timer} make convenient use of this * instance. */ static public Timer instance () { synchronized (threadLock) { TimerThread thread = thread(); if (thread.instance == null) thread.instance = new Timer(); return thread.instance; } }
public GdxKeyRepeatSystem(@Nonnull final GdxInputSystem gdxInputSystem) { input = gdxInputSystem.getInput(); this.gdxInputSystem = gdxInputSystem; keyRepeatTimer = new Timer(); keyRepeatTasks = new IntMap<Timer.Task>(); repeatingKeys = new IntArray(); keyRepeatRates = new IntFloatMap(); keyRepeatStartDelays = new IntFloatMap(); currentRepeatingKeyTask = null; currentRepeatingGdxKeyCode = 0; currentRepeatingKeyIndex = 0; }
public void resume () { synchronized (threadLock) { long delayMillis = System.nanoTime() / 1000000 - pauseMillis; for (int i = 0, n = instances.size; i < n; i++) instances.get(i).delay(delayMillis); pauseMillis = 0; threadLock.notifyAll(); } }
protected void setCursorPosition (float x, float y) { cursor = letterUnderCursor(x); cursorOn = focused; blinkTask.cancel(); if (focused) Timer.schedule(blinkTask, blinkTime, blinkTime); }
/** Schedules a task on {@link #instance}. * @see #scheduleTask(Task, float, float, int) */ static public Task schedule (Task task, float delaySeconds, float intervalSeconds, int repeatCount) { return instance().scheduleTask(task, delaySeconds, intervalSeconds, repeatCount); }
/** Schedules a task to occur once as soon as possible, but not sooner than the start of the next frame. */ public Task postTask (Task task) { return scheduleTask(task, 0, 0, 0); }
/** Timer instance singleton for general application wide usage. Static methods on {@link Timer} make convenient use of this * instance. */ static public Timer instance () { synchronized (threadLock) { TimerThread thread = thread(); if (thread.instance == null) thread.instance = new Timer(); return thread.instance; } }