| Package | org.goasap.interfaces |
| Interface | public interface ILiveManager extends IManager |
[This is a more advanced manager interface, so if
you are just getting started with Go's management system it is suggested that
you focus on IManager & IManageable, and save this
section for when you need it.]
Hypothetical examples:
Each ILiveManager receives a special onUpdate() callback
after GoEngine completes each pulse cycle for any particular pulseInterval.
This callback receives three things: the pulseInterval associated with the
cycle, an array containing the items updated, and the synced current-time value
that was sent to all the items as update() was called. (Background: GoEngine
stores different lists for every different pulseInterval specified by animation
items. Usually users will stick to a single pulseInterval but at times it can
be beneficial to run some animations slower than others – such as the readouts
in a spaceship game's cockpit which don't need to refresh as often and can free
up processing power for the game if they don't.)
The list of updated items only includes items actually updated, which at
times can differ slightly from the items that have been added to GoEngine and
sent to the manager's reserve() method. (Background: when items are added to
GoEngine during its update cycle, it defers updating them until the next pulse
so as not to disrupt the cycle in progress.) Therefore, even though ILiveManager
extends IManager and contains reserve() and release() methods,
those methods are often not needed here, since you can filter and make use of
the incoming array of updated items on each update. This can also relieve such
managers from needing to store and manage complex handler lists (as
OverlapMonitor does).
ILiveManager instances registered using GoEngine.addManager()
are stored in an ordered list. You can control the priority of updates in a
program by adding certain managers before others.
See also
| Method | Defined by | ||
|---|---|---|---|
|
onUpdate(pulseInterval:int, handlers:Array, currentTime:Number):void
GoEngine pings this function after each update() cycle for each pulse.
| ILiveManager | ||
![]() |
release(handler:IManageable):void
GoEngine reporting that an IManageable is being removed from its pulse list.
| IManager | |
![]() |
reserve(handler:IManageable):void
GoEngine reporting that an IManageable is being added to its pulse list.
| IManager | |
| onUpdate | () | method |
public function onUpdate(pulseInterval:int, handlers:Array, currentTime:Number):voidGoEngine pings this function after each update() cycle for each pulse.
ParameterspulseInterval:int — The pulse interval for this update cycle (-1 is ENTER_FRAME)
|
|
handlers:Array — The list of handlers actually updated during this cycle
|
|
currentTime:Number — The clock time that was passed to items during update
|