Jump to content
Search Community

Rotate around center with starling displayObject

Pilatus test
Moderator Tag

Recommended Posts

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. 

Link to comment
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
Link to comment
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.
×
×
  • Create New...