[Golist] HydroTween init3D
Donovan Adams
donovan at hydrotik.com
Wed Jul 30 07:26:26 PDT 2008
Sorry I was half asleep this morning and totally missed the problem!
Yes that is a bug, and thanks Mo for the perfect fix:)
*********
That's because it is being called multiple times when multiple tweens
are running.
Here's how you can use Go to automate the process so it happens only
once per pulse cycle, at just the right moment:
- There's a new interface in Go called ILiveManager, just added it a
few revs ago. What it does is that each time any pulse cycle
completes, the manager gets its own update() call.
- when init3D is called, automatically register a manager that you
write, something like class Hydro3DRefresh implements ILiveManager.
- the manager has reserve() and release() methods when items are added
and removed - store items if they are 3D tweens. (Check their
properties or target types or whatever.) Use a dictionary with the
items as the keys and any arbitrary whatnot as the value:
myDict[ item ] = 1 which gives you direct lookup access without any
looping. When release() is called: if (myDict[item]!=null) { delete
myDict[item]; } - it's that easy.
- Your ILiveManager's update method is called within the pulse cycle,
and just after all tweens are updated - the perfect moment to refresh
the 3D scene just once per cycle!
* [ I heart Go's automation layer - its best feature! ] *
moses
_______________________________________________
GoList mailing list
GoList at goasap.org
http://goasap.org/mailman/listinfo/golist_goasap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://goasap.org/pipermail/golist_goasap.org/attachments/20080730/9c5baa4f/attachment.html
More information about the GoList
mailing list