Jump to content
Search Community

Feature request: smart cacheAsBitmap un/re-setter

BartMM test
Moderator Tag

Recommended Posts

I'd like to put in a request to have a feature that will set and unset the DisplayObject.cacheAsBitmap for the DisplayObject's you're tweening, to optimize renderng speeds.

 

DisplayObject.cacheAsBitmap works great for speeding up rendering of non-changing complex objects, but if you're tweening properties other then DisplayObject.x or DisplayObject.y it will actually make stuff slower (since besides re-rendering the object it's also updating the cache). This can have a very significant impact on overall performance.

 

Currently we unset cacheAsBitmap when tweening starts, and set it again in an onComplete handler, but we're doing this so much its getting a bit silly. So maybe it would be usefull if TweenMax has a feature that would do this for us. The ultimate version would check if cacheAsBitmap was enabled, check if your tweening a property that invalidates the cache, then it can disable caching, do the tween and afterwards restore the property.

 

Im not sure how this would be implemented in a user-friendly way, maybe it's a global config, or maybe only a extra tweeining property (like 'autoBitmapCache:true' or a nice optional plugin.

 

Grtz,

 

B.

Link to comment
Share on other sites

How about a simple CacheAsBitmapPlugin that allows you to define what the cacheAsBitmap should be during the tween, like:

 

TweenLite.to(mc, 1, {x:100, cacheAsBitmap:true});

 

I've attached the plugin I whipped together. When the tween is done, it'll set the cacheAsBitmap back to whatever it was before the tween began. Cool? You like?

Link to comment
Share on other sites

  • 4 weeks later...
How about a simple CacheAsBitmapPlugin that allows you to define what the cacheAsBitmap should be during the tween, like:
TweenLite.to(mc, 1, {x:100, cacheAsBitmap:true});

When the tween is done, it'll set the cacheAsBitmap back to whatever it was before the tween began.

 

Hi Jack, this sounds great. Is this available for the AS2 version? I downloaded the latest and did not see a "CacheAsBitmapPlugin.as" in the AS2 plugins folder, it would be great to have in the AS2 version also. I also could not find this feature in the online/offline docs, perhaps I just overlooked it?

 

Thanks.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...