Jump to content
Search Community

Smoothest tweens on the iPad

davelassanske test
Moderator Tag

Recommended Posts

Anyone have recommendation for getting the smoothest tweens on the iPad with our beloved GreenSock classes? I've been noticing some frame dropping when executing tweens in the app I'm developing. Here's what I have going on when I notice it:

 

//advance a movieclip mask to reveal part of image
TweenMax.to(this.levelMask, 1, {frame:theRot, ease:Linear.easeNone});

//scale down the clicked sprite
this.timeline = new TimelineLite();
this.timeline.append( TweenMax.to(this.dotArray[i], .5, {scaleX:1.5,scaleY:1.5,ease:Elastic.easeOut}) );
this.timeline.append( TweenMax.to(this.dotArray[i], .5, {scaleX:0,scaleY:0,ease:Strong.easeOut}) );
this.timeline.play();

//play the next audio cue
TweenMax.delayedCall(1.5, playCue);

 

Any thoughts? Should I remove the event listener from the clicked sprite right away? Fire the tweens in a different order? Thanks!

Link to comment
Share on other sites

Typically ActionScript execution pales in comparison to graphics rendering in terms of CPU utilization. The ratio is literally 100:1 or more in most scenarios. So I highly doubt that tweaking your tweens will get you any noticeable gains in performance. Flash (or the iPad) is probably just having a hard time rendering the scaled graphics. I'm sure you know this, but TweenLite and TweenMax are EXTREMELY optimized for maximum performance already (http://www.greensock.com/tweening-speed-test/). But I will mention a few things:

 

1) Try using transformMatrix instead of plain scaleX/scaleY tweens - see the Tips & Tricks page for details: http://www.greensock.com/tweening-tips/

 

2) Avoid using vector graphics - use bitmaps instead.

 

3) Avoid setting cacheAsBitmap to true on assets that you're scaling because it forces Flash to re-render the cached bitmap every time the scale is changed.

 

4) If possible, avoid using filters on those scaled graphics because not only are filters CPU-intensive, but they force cacheAsBitmap to true.

 

Again, check out the speed tips on the Tips & Tricks page: http://www.greensock.com/tweening-tips/

Link to comment
Share on other sites

  • 5 months 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...