new lime.scheduleManager()
Unified timer provider class
Don't create instances of this class. Used the shared instance.
This:
- Source:
- schedulemanager.js, line 14
Summary
Members |
||
---|---|---|
<static> |
USE_ANIMATION_FRAME :boolean
Whether to use requestAnimationFrame instead of timer events
Exposed here so it could be disabled if needed.
|
Methods |
||
---|---|---|
<private, static> |
activate_ ()
Start the internal timer functions
|
|
<private, static> |
animationFrameHandler_ ()
Webkit implemtation of requestAnimationFrame handler.
|
|
<private, static> |
beforePaintHandler_ ()
Mozilla < 11 implementation of requestAnimationFrame handler.
|
|
<static> |
callAfter (f, context, delay)
Set up function to be called once after a delay
|
|
<static> |
changeDirectorActivity (director, value)
Change director's activity. Used for pausing updates when director is paused
|
|
<private, static> |
disable_ ()
Stop interval timer functions
|
|
<private, static> |
dispatch_ (delta)
Call all scheduled tasks
|
|
<static> |
getDisplayRate () → {number}
Returns maximum fire rate in ms. If you need FPS then use 1000/x
|
|
<static> |
schedule (f, context, opt_task)
Schedule a function. Passed function will be called on every frame
with delta time from last run time
|
|
<static> |
scheduleWithDelay (f, context, delay, opt_limit)
Set up function to be called repeatedly after a delay
|
|
<static> |
setDisplayRate (value)
Sets maximum fire rate for the scheduler in ms.
If you have FPS then send 1000/x
Note that if animation frame methods are used browser chooses
max display rate and this value has no effect.
|
|
<private, static> |
stepTimer_ ()
Timer events step function that delegates to other objects waiting
|
|
<static> |
unschedule (f, context)
Unschedule a function. For functions that have be previously scheduled
|
Classes
Members
-
<static> USE_ANIMATION_FRAME :boolean
-
Whether to use requestAnimationFrame instead of timer events Exposed here so it could be disabled if needed.
- Source:
- schedulemanager.js, line 111
Methods
-
<private, static> activate_()
-
Start the internal timer functions
This:
- Source:
- schedulemanager.js, line 191
-
<private, static> animationFrameHandler_()
-
Webkit implemtation of requestAnimationFrame handler.
This:
- Source:
- schedulemanager.js, line 241
-
<private, static> beforePaintHandler_()
-
Mozilla < 11 implementation of requestAnimationFrame handler.
This:
- Source:
- schedulemanager.js, line 263
-
<static> callAfter(f, context, delay)
-
Set up function to be called once after a delay
Parameters:
Name Type Description f
function Function to be called. context
Object Context used when calling object. delay
number Delay before calling. - Source:
- schedulemanager.js, line 341
-
<static> changeDirectorActivity(director, value)
-
Change director's activity. Used for pausing updates when director is paused
This:
Parameters:
Name Type Description director
lime.Director Director. value
boolean Active or inactive? - Source:
- schedulemanager.js, line 315
-
<private, static> disable_()
-
Stop interval timer functions
This:
- Source:
- schedulemanager.js, line 220
-
<private, static> dispatch_(delta)
-
Call all scheduled tasks
This:
Parameters:
Name Type Description delta
number Milliseconds since last run. - Source:
- schedulemanager.js, line 290
-
<static> getDisplayRate() → {number}
-
Returns maximum fire rate in ms. If you need FPS then use 1000/x
This:
- Source:
- schedulemanager.js, line 118
Returns:
Display rate.- Type
- number
-
<static> schedule(f, context, opt_task)
-
Schedule a function. Passed function will be called on every frame with delta time from last run time
This:
Parameters:
Name Type Argument Description f
function Function to be called. context
Object The context used when calling function. opt_task
lime.scheduleManager.Task <optional>
Task object. - Source:
- schedulemanager.js, line 147
-
<static> scheduleWithDelay(f, context, delay, opt_limit)
-
Set up function to be called repeatedly after a delay
This:
Parameters:
Name Type Argument Description f
function Function to be called. context
Object Context used when calling object. delay
number Delay before calling. opt_limit
number <optional>
Number of times to call. - Source:
- schedulemanager.js, line 353
-
<static> setDisplayRate(value)
-
Sets maximum fire rate for the scheduler in ms. If you have FPS then send 1000/x Note that if animation frame methods are used browser chooses max display rate and this value has no effect.
This:
Parameters:
Name Type Description value
number New display rate. - Source:
- schedulemanager.js, line 131
-
<private, static> stepTimer_()
-
Timer events step function that delegates to other objects waiting
This:
- Source:
- schedulemanager.js, line 275
-
<static> unschedule(f, context)
-
Unschedule a function. For functions that have be previously scheduled
This:
Parameters:
Name Type Description f
function Function to be unscheduled. context
Object Context used when scheduling. - Source:
- schedulemanager.js, line 162