Twease 2.0 Beta

When you create a class that makes other developer’s lives easier, and see something that you made help make something pretty rad, it’s truly a magical feeling. When I see Partigen being used in the real world, I get giddy like a school girl. Albeit Twease is a bit different, it’s still a nice feeling.

So that’s why I’ve been hard at work on version 2 of this compact, yet powerful and robust tweening engine, packing in more bang-for-your-bytes. Originally it was just going to be a minor upgrade with added color and simple bezier tweening, but it ended up so much more.

This beta is, in my opinion, fairly stable, and is being used in my own production projects. In fact, some of the features have been birthed due to necessity. I’d like to package this up nicely with docs et all, but first want to give it a test-drive with the public.

So without further adue, here’s what’s new with Twease 2.0 Beta (from the change log):

New Features

  • Tween startup performance boost eliminates staggered starting of simultaneous tweens
  • Twease core now has integrated mulit-point bezier tweening for any property
  • Twease.tween() rate property allows you to tween at a constant rate instead of a specific duration of time
  • Twease.tween() progress parameter allows you to start a tween at any point in its life 0(start) - 1(finished)
  • Extend methods and automation to extend core Twease methods and tweenable properties
  • Colors, Extras, and Texts classes that use new Extend class
  • Texts class lets you tween Object-strings (var mytext:Object = {text:”A”}) based on a given characterset
  • Colors class lets you tween color transformation objects such as tint, brightness and contrast
  • Twease.render() method allows manual rendering of non-engine managed tween objects
  • Twease.tween() 2nd parameter for sequence and single tween target-overrides
  • Twease.tween() 3rd parameter for non-managed tween, true makes a new object, passing an object uses that
  • Tween object has easeposition property that returns the position of a tween on an ease path (0-1)
  • Stack option in tween call to enable stacking on a per-tween basis
  • Cycles support for function-only calls including delays
  • Colors: static color functions: ’setColor’, ‘getColorObject’
  • Twease: baseprops array and compareInObject method

So a quick feature summary: mulit-point bezier tweening, run tween at a given rate, start tweens at a certain progress percent, tween colors and text, non-managed tween rendering, per-tween stacking, and a performance boost to boot.

The core Twease engine has been setup to interface with the Extend class, which lets non-essential methods and tweenable properties to be integrated seamlessly into the engine. Methods available in the extend class help automate integration, which can be seen with the Colors and Texts classes.

As you can imagine, this makes Twease the launching pad for any tweenable property imaginable. With it’s modularity, Twease lets you easily load only the features you use, keeping control over your file size.

Examples (ah.. finally the good stuf):

Example 1 - Multi-point bezier and color tween using rate instead of time (click to toggle pausing the tween)

Example 2 - This example shows the Texts extension tweening words in a textfield.

Download

Twease now is under version control, and has a home over at Google Code. You can use svn or browse the repository to download the files for now.

I will be making a new post going into detail on the biggest features, with syntax and code examples very soon, as to not clog up this entries arteries.

Tags:

17 Responses to “Twease 2.0 Beta”

  1. Colin Says:

    You kick major ass. Great work.

  2. andrew Says:

    Thanks, I appreciate it very much Colin!

  3. Tomer Says:

    Thanks alot!

  4. Ben Says:

    Andrew you are a bloody legend your twease is gonna make a whole lotta people make some truly great stuff !!!!

  5. andrew Says:

    Why thank you guys, I hope you enjoy it a lot.

  6. art Says:

    Wowsa! Been checking in regularly to see about the 1.2 release - but this just made me whoop out loud in a crowded room, and now everyone’s looking at me like I’m some sort of wingnut…

    Can’t wait to try it out - big ups there, Andrew! All your Tweens are belong to us indeed.

    (btw: just wrapping up a site where we used Partigen in several places - when we go live I’ll post to the Partigen boards…)

  7. andrew Says:

    Awesome Art! Thats great to hear. Haha I love how you got excited, that’s priceless.

    Since you’re a Partigen fan, you’ll be happy to know Twease 2.0 will become the official tweening engine for Partigen 1.5, decreasing swf size about 15k.

  8. mortenft Says:

    I have been using Twease a while now, and it works great!

    However, the setActive method has me a little confused; I experience different behaviour if i call setActive(false) and setActive(false,mcMovie).

    setActive(false) pauses everything, and when I call setActive(true), it picks up where it stoped just fine. If I use setActive(false,mcMovie), the tween for mcMovie is paused, however, if I call setActive(true,mcMovie) it doesn’t continue where it stopped - it starts the tween over - causing some serious issues for me.

    I use Twease many places in the same app, at the same time, and I need to be able to stop only certain tweens - however, that doesn’t really work - it seems to be all or nothing - any comments/ideas for me ?

  9. Gaynor Says:

    Hi Andrew
    Can’t wait to start using Twease, but seem to be having a bit of a blonde moment. Can’t seem to unzip the file. Is it not for Mac - I get a format error from Stuffit?
    Any help much appreciated
    have a great day
    Gaynor

  10. andrew Says:

    Gaynor: I developed it on a mac, so it should work just fine. Have you tried using the built in unzip archiver in OS X? If not you can get always it from SVN. If you’d rather not, I can try emailing you another archive.

  11. Gaynor Says:

    Hi Andrew
    all sorted - the default (Stuffit) expander usually opens most things, but I ended up using the BOM Archive, which presented no problems.
    Thanks for getting back to me so quickly.
    Just one question - the filters.as has “not functional yet” commented out - I’ve downloaded Beta 2.0 (I’m still working on AS2.0) - does this mean this twease doesn’t handle blur tweens yet?
    thanks again
    Gaynor

  12. andrew Says:

    You are correct, in regards to native support, such as tween({blurX:5}).

    But you can tween filters with a bit more work such as:

    import flash.filters.BlurFilter;
    var filter:BlurFilter = new BlurFilter(0, 0, 3);
    Twease.tween({target:filter, blurX:8, blurY:8, time:3, ease:’easeOutElastic’, upfunc:function(){my_mc.filters = [filter]}});

    You can read more about that here: http://play.visualcondition.com/twease/#filters

    Hope this helps!

  13. andrew Says:

    mortenft: Are you using AS2 or AS3? I just tested AS3 and it worked fine for me. Both pausing and resuming. Maybe it’s something else?

  14. Gaynor Says:

    Hi Andrew
    Thanks so much for your quick and detailed response - it’s greatly appreciated.
    I’m all set to launch myself into the world of twease :) cheers and have a sensational day
    Gaynor

  15. Colin Says:

    Andrew, any chance you can post the source for the example on bezier tweening?

  16. andrew Says:

    @Colin: And what example would that be? Is there one in the example files at Google Code?

  17. David Says:

    Champion! Have emulated the gotoAndLearn advanced Fuse lesson with Twease in Flash Studio 8. And now trying Twease on a glow filter. Thanks for all your work.

Leave a Reply