[Golist] cycles design continued...
Moses Gunesch
moses at goasap.org
Mon Mar 24 13:08:11 PDT 2008
Okay here's what I've cooked up:
A couple of simple iterator utils that sit in the managers package,
Repeater & LinearGoRepeater.
This has allowed me to condense the cycles feature of LinearGo quite a
bit... the class no longer contains properties cycles, easeOnCycle or
the two properties that were still needed, extra easing params for
easeOnCycle and an option to play the tween multiple times forwards
instead of cycling back-and-forth. All of that has been neatly
encapsulated so you can now do,
mytween.repeater.cycles = 2;
mytween.repeater.reverseOnCycle = false; // play fwd both times
Let me know what you think of this implementation, the release
including useFrames is pretty much ready now.
-moses
Class Repeater
Constant Defined by
INFINITE : uint = 0
[static] Makes code more human-readable, like new
Repeater(Repeater.INFINITE);
Repeater
Property Defined by
currentCycle : uint
[read-only] Current cycle starting at 0, which will continue to
increase up to cycles or indefinitely if cycles is set to
Repeater.INFINITE (zero).
Repeater
cycles : uint
Number of times the Repeater will iterate, which can be set to zero or
Repeater.INFINITE for indefinite repeating.
Repeater
done : Boolean
[read-only] True if cycles is not infinite and currentCycle has
reached cycles.
Repeater
Class LinearGoRepeater
direction : int
[read-only] Current play direction depending on reverseOnCycle and
currentCycle.
LinearGoRepeater
easingOnCycle : Function
Storage for optional secondary easing to use on reverse cycles.
LinearGoRepeater
extraEasingParams : Array
Additional parameters to use with easingOnCycle if the function
accepts more than four.
LinearGoRepeater
reverseOnCycle : Boolean
Whether tween direction should reverse every other cycle.
LinearGoRepeater
Class LinearGo
LinearGo(delay:Number,
duration:Number,
easing:Function = null,
extraEasingParams:Array = null,
repeater:LinearGoRepeater = null, // new!
useRelative:Boolean = false,
useRounding:Boolean = false,
useFrames:Boolean = false, // new!
pulseInterval:Number)
repeater : LinearGoRepeater
[read-only] A LinearGoRepeater instance that defines options for
repeated or back-and-forth cycling animation.
Class SequenceBase
repeater : Repeater
[read-only] The sequence's Repeater instance, which may be used to
make the sequence loop and play more than one time.
SequenceBase
(replaces repeatCount & currentCount properties for Sequence &
SequenceCA)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://goasap.org/pipermail/golist_goasap.org/attachments/20080324/0d6eb2e3/attachment.html
More information about the GoList
mailing list