Jump to content
Search Community

SplitTextField: regOffsetY and regOffsetX not working

ppdc test
Moderator Tag

Recommended Posts

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

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

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