Share Posted December 22, 2014 I can't seem to get this working. I am trying to scale a textfield (by letter) from the center, but whatever I change regOffsetY to, it always scales from the top left corner. What am I doing wrong? Thank you. Peter test.fla.zip Link to comment Share on other sites More sharing options...
Share Posted December 22, 2014 The regOffsetX and regOffsetY are applied to the parent Sprite that contains all you split characters. It is not the origin of each individual split character (word, or line). Place this code in your file to see how these params work import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import com.greensock.text.SplitTextField; var tl = new TimelineLite({paused:true}); var stf1:SplitTextField = new SplitTextField(txt,"characters",550,400); TweenLite.to(stf1, 5, {rotation:360}) Notice the entire textfield spins around the lower right corner. To scale each character from its center, you can use the TransformAroundCenterPlugin (which comes with your membership). Try this import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import com.greensock.text.SplitTextField; TweenPlugin.activate([TransformAroundCenterPlugin]); var tl = new TimelineLite({paused:true}); var stf1:SplitTextField = new SplitTextField(txt,"characters",550,400); TweenMax.staggerFrom(stf1.textFields, 1, {transformAroundCenter:{scale:0}}, 0.5); That should do the trick. Let us know if you need more help and thank you for supporting us through your Club GreenSock membership. Happy Tweening! Link to comment Share on other sites More sharing options...
Author Share Posted December 22, 2014 Great, thank you! Just out of curiosity: Why was my regOffsetY-approach not working? Merry Christmas or whatever you're celebrating! Link to comment Share on other sites More sharing options...
Share Posted December 22, 2014 You were setting the regOffSets properly, you just didn't notice anything because you weren't rotating or scaling stf1 (like in my first example above). You were only animating stf.textFields. Hopefully that helps, and Merry Christmas to you too! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now