Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Slopes

Scale Effects Very Slow On Android

Recommended Posts

Hello,

 

We have been using the Greensock library in an Adobe AIR application for a while now with really no problems.  We decided to try our Windows based application on an Android device and found that most things work quite well.  The only problem we are seeing with the Greensock library turns up when we use scale effects.  By this, I mean any time I attempt to scale a SplitTextField  from say 4 to 1, the system lags.  If I scale multiple SplitTextFields at once and by letter, then system can almost crash.  The board we are using is running one of the latest version of Android and is capable of  outputting HD content.

 

Below is the code for one of the animations being affected.  Each letter should scale down and rotate in, staggered.

// target is the object we are going to animate
// time is the total amount of time for the animation
public static function MyEffect(target:SplitTextField, time:Number):TimelineMax{
// Activate plugins
	TweenPlugin.activate([TransformAroundCenterPlugin, AutoAlphaPlugin]);
// Create new TimelineMax Object
	var t:TimelineMax = new TimelineMax();
// Determine how long each letter should animate
	var timePerHold:Number = time / target.textFields.length;
// Go through each textField in the SplitTextField and complete the following animation
	for(var x:int = 0; x < target.textFields.length; x++){
// Use 20% of the time to rotate the text and scale the text half way
		t.fromTo(target.textFields[x], timePerHold * .2, {transformAroundCenter:{scale:4, rotation:-180}, alpha:0}, {transformAroundCenter:{scale:2, rotation:0}, alpha:1});
// Use 80% of the time to finish scaling the text
		t.to(target.textFields[x],timePerHold * .8, {transformAroundCenter:{scale:1}, ease:Elastic.easeOut});
	}
        return t;
}

I was going to do my best to optimize the system but I wanted to go about it the right way and not just start guessing how to fix this.  Any thoughts or direction would be greatly appreciated.

 

Thank you!

Link to post
Share on other sites

Hm, that sounds to me like it's unrelated to GSAP, and is most likely the way that the software/hardware interact (outside of GSAP). For example, if something changes sizes, it may be getting flagged as needing to be re-rasterized at that new size (so that it doesn't pixelize) whereas if it's only moved or faded or rotated, the GPU can very easily chew through that using the existing rasterized version in memory. You could try enabling the cacheAsBitmap flag, but I'm not really sure that'd help. I wish I had better news for you. 

Link to post
Share on other sites

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.

×