public interface MasterTimer extends FXGLListener, UserProfileSavable
| Type | Property and Description |
|---|---|
javafx.beans.property.IntegerProperty |
fps |
javafx.beans.property.IntegerProperty |
performanceFPS |
javafx.beans.property.ReadOnlyLongProperty |
playtime |
javafx.beans.property.ReadOnlyLongProperty |
tick |
| Modifier and Type | Method and Description |
|---|---|
void |
addUpdateListener(UpdateEventListener listener)
Adds update event listener.
|
javafx.beans.property.IntegerProperty |
fpsProperty() |
default int |
getFPS() |
long |
getNow()
Current time for this tick in nanoseconds.
|
default int |
getPerformanceFPS() |
default long |
getPlaytime()
Gets the value of the property playtime.
|
default long |
getPlaytimeHours() |
default long |
getPlaytimeMinutes() |
default long |
getPlaytimeSeconds() |
default long |
getTick()
Returns current tick (frame).
|
javafx.beans.property.IntegerProperty |
performanceFPSProperty() |
javafx.beans.property.ReadOnlyLongProperty |
playtimeProperty() |
void |
removeUpdateListener(UpdateEventListener listener)
Removes update event listener.
|
void |
reset()
Clears all registered timer based actions.
|
TimerAction |
runAtInterval(Runnable action,
javafx.util.Duration interval)
The Runnable action will be scheduled to run at given interval.
|
TimerAction |
runAtIntervalWhile(Runnable action,
javafx.util.Duration interval,
javafx.beans.property.ReadOnlyBooleanProperty whileCondition)
The Runnable action will be scheduled for execution iff
whileCondition is initially true.
|
TimerAction |
runOnceAfter(Runnable action,
javafx.util.Duration delay)
The Runnable action will be executed once after given delay
|
javafx.beans.property.ReadOnlyLongProperty |
tickProperty() |
double |
tpf() |
onExit, onPause, onReset, onResumeload, savejavafx.beans.property.ReadOnlyLongProperty playtimeProperty
getPlaytime()javafx.beans.property.ReadOnlyLongProperty tickProperty
getTick()javafx.beans.property.IntegerProperty fpsProperty
javafx.beans.property.IntegerProperty performanceFPSProperty
getPerformanceFPS()long getNow()
default long getPlaytime()
default long getPlaytimeHours()
default long getPlaytimeMinutes()
default long getPlaytimeSeconds()
javafx.beans.property.ReadOnlyLongProperty playtimeProperty()
getPlaytime()default long getTick()
The update to this number happens when a new update cycle starts.
double tpf()
javafx.beans.property.ReadOnlyLongProperty tickProperty()
getTick()default int getFPS()
javafx.beans.property.IntegerProperty fpsProperty()
default int getPerformanceFPS()
javafx.beans.property.IntegerProperty performanceFPSProperty()
getPerformanceFPS()TimerAction runAtInterval(Runnable action, javafx.util.Duration interval)
Note: the scheduled action will not run while the game is paused.
action - the actioninterval - timeTimerAction runAtIntervalWhile(Runnable action, javafx.util.Duration interval, javafx.beans.property.ReadOnlyBooleanProperty whileCondition)
The action will be removed from schedule when whileCondition becomes false.
Note: the scheduled action will not run while the game is paused
action - action to executeinterval - interval between executionswhileCondition - conditionTimerAction runOnceAfter(Runnable action, javafx.util.Duration delay)
Note: the scheduled action will not run while the game is paused
action - action to executedelay - delay after which to executevoid reset()
void addUpdateListener(UpdateEventListener listener)
listener - the listener to addvoid removeUpdateListener(UpdateEventListener listener)
listener - the listener to removeCopyright © 2017. All rights reserved.