Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Wuzseen on November 06, 2013, 12:29:46 AM

Title: TweenScale for a FlyIn Menu
Post by: Wuzseen on November 06, 2013, 12:29:46 AM
I'm using tweenscale for the visual effect on a fly in menu.  I'm applying it to a whole panel and, while it works, it is scaling from the wrong direction.  Moreover, the anchors of the objects don't seem to effect it.

So I have a button and when I press it a menu flys out of it.  I want it to fly out from the left to the right.

http://i.imgur.com/ugIIQBt.png

As you can see in that screenshot my object just tweens its x scale from 0 to 1... but it seems to do this from the right to the left, not the left to the right.  Not even from the center out which is what I would expect as the default behavior.
Title: Re: TweenScale for a FlyIn Menu
Post by: ArenMook on November 06, 2013, 07:21:20 AM
Why do you have two tweenscale components on the same object? Scaling happens just by altering the transform's scale, which is bases off the transform's position as the center. If you don't like where it's scaling from, then move the content accordingly.
Title: Re: TweenScale for a FlyIn Menu
Post by: Wuzseen on November 06, 2013, 09:29:10 AM
That's my problem--I can't set it to go from the bottom left of the panel.  Moreover, when I tried setting the anchors of the objects inside the panel I did not get the behavior I was looking for.

As to the two tweenscale components--I have to admit I didn't find a way to reverse the tween (I didn't look very hard) and for the way I was organizing my mind at the time, I just felt it was easier to have a tween in and a tween out.
Title: Re: TweenScale for a FlyIn Menu
Post by: ArenMook on November 07, 2013, 04:33:54 AM
UITweener.PlayForward(), UITweener.PlayReverse().

Make sure you're working with "Pivot" coordinates, not "Center" (on the toolbar, below the "GameObject" menu). This is a fairly basic Unity usability question at this point.