|
HydroTween
HydroTween is a multi-use tweening parser for Go developed by DonovanAdams.
Introduction// Color Tweening!
HydroTween.go(mc, {color:0xFF0000}, 2, 0, Elastic.easeOut);
// Or reset back to the original color
HydroTween.go(mc, {color:HydroTween.RESET}, 2, 0, Elastic.easeOut);
// Fuse style sequencing!
var seq1:HydroSequence = new HydroSequence(
{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:0x0000FF, 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();
// Papervision3D Tweening!
// Call once to setup a 3D tweens renderer
HydroTween.init3D(renderer, scene, camera, viewport);
// Simple Papervision3D Tween
HydroTween.go(plane, {rotationX:100, z:500}, 2, 0, Elastic.easeOut);HydroTween is a multi-use tweening parser for Go developed by DonovanAdams. It will tween individual targets, or you can use Fuse style sequencing. Currently HydroTween will tween the following properties:
More info can be found at Hydrotik Tweening ExamplesGeneral: HydroTween.go(mc, {x:400}, 2, 0, Elastic.easeOut);Start Values (Currently only works with NON image/bitmap matric properties: HydroTween.go(mc, {start_x:100, x:400}, 2, 0, Elastic.easeOut);Filter: HydroTween.go(mc, {Glow_color:0x0000FF, Glow_blurX:8, Glow_blurY:8, Glow_strength:3}, 2, 0, Elastic.easeOut);Image/Bitmap/ColorMatrix: // Brightness
HydroTween.go(mc, {brightness:2}, 2, 0, Elastic.easeOut);
// Contrast
HydroTween.go(mc, {contrast:2}, 2, 0, Elastic.easeOut);
// Hue
HydroTween.go(mc, {hue:45}, 2, 0, Elastic.easeOut);
// Saturation
HydroTween.go(mc, {saturation:-1}, 2, 0, Elastic.easeOut);
// Tint
HydroTween.go(mc, {tint:0x00FF00}, 2, 0, Elastic.easeOut);
// Color
HydroTween.go(mc, {color:0xFF0000}, 2, 0, Elastic.easeOut);
// Color Reset (This will tween back to it's original value
HydroTween.go(mc, {color:-1}, 2, 0, Elastic.easeOut);Matrix tweening (for array values such as sepia, etc) should make a return in the next update as well as a tint percentage value. Sound: // Volume
HydroTween.go(soundchannel, {volume:.1}, 2, 0, Elastic.easeOut);
// Contrast
HydroTween.go(soundchannel, {pan:-1}, 2, 0, Elastic.easeOut);Sound tweening takes the SoundChannel instance as a target. Text: HydroTween.go(textfield, {text:100}, 2, 0, Elastic.easeOut);This simply tweens the number from 0 to whatever param is specified and outputs to a textfield. I hope to expand on the functionality of this soon. Using Callbacks and Updaters: // Complete Callback
HydroTween.go(textfield, {text:100}, 2, 0, Elastic.easeOut, onCompleteHandler);
// Update Callback
HydroTween.go(textfield, {text:100}, 2, 0, Elastic.easeOut, null, onUpdateHandler);Fuse style Sequence Tweening: var seq1:HydroSequence = new HydroSequence(
{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:0x0000FF, 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();Autostart: AUTOSTART is a parameter that enables easy coding of a tween. For example: HydroTween.go(mc, {x:400}, 2, 0, Elastic.easeOut);
|
Sign in to add a comment
NOTE: The latest version of HydroTween does not support the "seconds" attribute. Use "duration" instead.
// Color Reset (This will tween back to it's original value HydroTween.go(mc, {color:-1}, 2, 0, Elastic.easeOut);
doesn't work for me.. turns it white instead of sprite original color