HydroTween + HydroSequence rev37
UPDATE: rev39, synced up with the 0.5.0 updates. Matrix tweening and some bug fixes. Fixed callback error from previous updates
Fuse style functionality has been moved from HydroTween to a separate class called HydroSequence! This decision was made to offer an easier and more flexible way to control sequences by having clearer access to SequenceCA super methods. Also makes it easier to enhance the functionality of the sequencing parser. Here is the new syntax:
{target:fusebox, x:320, duration:1, easing:Quadratic.easeInOut},
{target:fusebox, Blur_blurX:8, Blur_blurY:8, duration:1, easing:Quadratic.easeInOut},
{target:fusebox, color:0×0000FF, duration:1, easing:Quadratic.easeInOut},
{target:fusebox, Blur_blurX:0, Blur_blurY:0, duration:.8, easing:Quadratic.easeInOut},
{target:fusebox, x:400, duration:.5, easing:Quadratic.easeInOut}
);
seq1.addItem([{target:fusebox, rotation:270, duration:3, easing:Quadratic.easeInOut}, {func:trace, args:[“HELLO WORLD”]}]);
seq1.start();
Grouped Array targets are supported and the ability to add sequence objects with the addItem() method as well as using the constructor to create sequences.
In other news, I added a frame property to HydroTween which has been added to the demo swf here:
Also check out the GO Playground
Some extra advanced features from SequenceCA and beyond:
Duration Advance:
[
{
target:target,
x:400,
y:40,
Blur_blurX:32,
Blur_blurY:32,
DropShadow_distance:16,
DropShadow_alpha:16,
rotation:180,
start_alpha:.5,
alpha:1,
scaleX:5,
scaleY:5,
color:0×0000FF,
useRelative:true,
duration:1, // Note Duration is 1. When this finsishes, it waits for the other group item.
easing:Quintic.easeIn
},
{
target:target2,
x:300,
Blur_blurX:0,
Blur_blurY:0,
scaleX:1,
scaleY:1,
color:HydroTween.RESET,
duration:1, // Note Duration is one, but…
repeater:new LinearGoRepeater(2), // Repeater creates a 1 second tween * 2.
easing:Quintic.easeInOut
}
]);
// Here we add an advance property and instantiate an OnDurationComplete Object to tell
// the sequence to skip ahead after 1 second instead of waiting for the full duration of
// the sequence Object/item
goItem.addItem({target:[target,target2], advance:new OnDurationComplete(1), alpha:0, duration:6});
goItem.addItem({target:[target,target2], alpha:1, duration:1});
// Another grouped sequence Object/item with a function call
goItem.addItem([{target:[target,target2], x:10, duration:1},{func:trace, args:[“Start x tween”]}]);
goItem.addItem({func:trace, args:[“Sequence Complete”]});
goItem.start();
HydroTween + HydroSequence Source and Example
HydroTween + HydroSequence Source Only
Saturday, July 19th, 2008