Jump to content
GreenSock

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

Scale object on a stage (Animate) from the left to at 50%

Recommended Posts

Hi, excuse me for my lack of knowledge. I'm playing around with greensock/animate for the first time....

 

I am trying to scale an objects width from the left ('left_mc' across the width of the stage by 50%, I have the same happening the far right side ('right_mc')), almost like closing curtains, both objects are at very far edges of the stage. I've been tinkering with 'Scale' using TweenMax, but I cant fgure out how to pin an object and scale in one direction. Also, I guess I'll have to establish the stage dimensions first so I can define the percentage. Can someone please help point me in the right direction? or any tips on animations relative to the stage with scaling.

 

many thanks.

 

lister

Link to comment
Share on other sites

Hey @lister110

I think you're looking for transformOrigin! You use it to define where you want the origin of a transform to be.

For curtains, the left curtain would have transformOrigin: 'left' and the right curtain would have transformOrigin: 'right'

You can't easily define scaling by a percentage of the container or stage - and I don't really know how animate works, but you could use xPercent  for a percentage of the curtain.

Also - We recommend using GSAP3 rather than TweenMax - we updated a lot since then! (Unless this is an Animate specific constraint)

  • Like 1
Link to comment
Share on other sites

ahh thanks, ill have a look..

  • Like 1
Link to comment
Share on other sites

Shout if you need any nudges in the right direction ☺️

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.
×