Pilatus

Rotate around center with starling displayObject

Recommended Posts

Hello,

 

Is there a way to rotate starling display objects around the center?

The plugins do not work with starling so there must be another way to use TweenMax with it.

 

Thanks.

Share this post


Link to post
Share on other sites

GSAP can tween any property of any object, but some of the plugins (like TransformAroundCenterPlugin) rely on things like the target being a DisplayObject. GSAP wasn't really built to be compliant with a 3rd party library like Starling. Sorry. 

Share this post


Link to post
Share on other sites

aaah shame, would be nice to have a workaround.

Share this post


Link to post
Share on other sites

I made it work like this:

TweenMax.set(dispObj, {x:dispObj.x, y:dispObj.y});
dispObj.alignPivot();
TweenMax.set(dispObj, {x:dispObj.x+dispObj.pivotX, y:dispObj.y+dispObj.pivotY});
TweenMax.to(dispObj, 210, {useFrames:true, rotation: deg2rad(360), scale: 0.5, yoyo:true, repeat:-1, ease: Linear.easeNone});

Haven't really understoon why through, was more a trial error process.

Scaling and rotating around center with yoyo.

  • Like 1

Share this post


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.