Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: nah0y on June 21, 2012, 10:03:36 AM

Title: Immediate Tweens
Post by: nah0y on June 21, 2012, 10:03:36 AM
Hello,

I'm doing a lot of small "animations" (it's more state change) using UIButtonTween on a parent object, triggering a Tween on a child with a TweenPosition for example.

My problem is that I want the Tween to be immediate, so right now, I just put 0.000001 in the duration of the tween, but it's :
- ugly
- sometimes not working properly (when clicking like a mad person on the button)

It will be really useful to be able to put a duration of 0 so that it's immediate.

Of course, I could do all that using code, but here I just have to attach a script to my object and set a new position, color etc...
Title: Re: Immediate Tweens
Post by: ArenMook on June 21, 2012, 02:24:08 PM
Done. You will see it in the next update, along with the "Sample (float factor)" function, where factor is the 0-1 value in case you want to do sampling yourself.
Title: Re: Immediate Tweens
Post by: nah0y on June 21, 2012, 02:45:18 PM
Cool !

I did not understand what the Sample function is, but we'll see :)

Ps : Do you have a date for the new version ?
Title: Re: Immediate Tweens
Post by: ArenMook on June 21, 2012, 02:46:46 PM
Probably Sunday-ish.
Title: Re: Immediate Tweens
Post by: nah0y on June 21, 2012, 02:48:22 PM
Awesome !
Title: Re: Immediate Tweens
Post by: nah0y on June 27, 2012, 05:48:38 AM
I'm sorry to re-open the subject, but I've tested to set a delay of 0 with the new 2.0.9a version, and i Still have a little delay.

Let me explain :
I have a ImageButton, with a normal and pressed state. So when I press the button, it sets the pressed sprite.
I also have a UIButtonTween script attached to the ImageButton, that is triggered on OnPress and Play Direction : Toggle.

Finally, I have a child of the ImageButton, than is a label, with a TweenPosition script on it.
So when I PRESS the ImageButton, it triggers the TweenPosition (delay : 0) from the label.


But, when I press the ImageButton, I have the pressed sprite and then after a really small amount of time (maybe one or two frame ?) the label change its position.
Maybe it's REALLY fast, but I can definitely see it...
Title: Re: Immediate Tweens
Post by: ArenMook on June 27, 2012, 06:59:31 AM
If you can reproduce it with a simple scene (prefferably created with just NGUI package's assets), send it to support at tasharen.com, it might help.
Title: Re: Immediate Tweens
Post by: nah0y on June 27, 2012, 08:55:27 AM
Thanks for the suggestion,

As requested, it has been sent to your inbox,
I hope it will go through (25Mo...)

Also, it seems that when I put a delay of 0, it takes a delay of 1 instead, so after checking your code, I've put -1.
Title: Re: Immediate Tweens
Post by: PhilipC on June 27, 2012, 11:28:39 AM
We have received the package and have already fixed the offending code.

I have attached the changed file if you wish to use it right away. Other wise it will be in the next update
Title: Re: Immediate Tweens
Post by: nah0y on June 27, 2012, 11:34:03 AM
Awesome developers are awesome ;)
Title: Re: Immediate Tweens
Post by: nah0y on June 28, 2012, 09:22:08 AM
Just to say that it's working perfectly now :)

I've noticed that you've added a Bounce method, are you planning to make Bounce In & Bounce Out ?

Thanks again.
Title: Re: Immediate Tweens
Post by: PhilipC on June 28, 2012, 10:32:08 AM
Changing the direction changes between bounce in and bounce out (or at least i believe it does).
Title: Re: Immediate Tweens
Post by: nah0y on July 03, 2012, 11:36:05 AM
Hi !

What do you mean by changing direction ? Because I'm using the toggle direction that should change it, and it's not working as wanted.

You can see this, right here : http://www.youtube.com/watch?v=eu-rWnf8Qj8
Title: Re: Immediate Tweens
Post by: PhilipC on July 03, 2012, 02:29:26 PM
Ah I see, I do see what you mean, and sure I can add the other direction (99.9% sure at least). Give me some time.
Title: Re: Immediate Tweens
Post by: PhilipC on July 03, 2012, 10:31:26 PM
Should be done just need to do a new release.
Title: Re: Immediate Tweens
Post by: nah0y on July 04, 2012, 12:20:22 AM
Awesome support ! As always ;)