Author Topic: Immediate Tweens  (Read 12280 times)

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Immediate Tweens
« 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...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Immediate Tweens
« Reply #1 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.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #2 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 ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Immediate Tweens
« Reply #3 on: June 21, 2012, 02:46:46 PM »
Probably Sunday-ish.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #4 on: June 21, 2012, 02:48:22 PM »
Awesome !

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #5 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...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Immediate Tweens
« Reply #6 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.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #7 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.

PhilipC

  • Guest
Re: Immediate Tweens
« Reply #8 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

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #9 on: June 27, 2012, 11:34:03 AM »
Awesome developers are awesome ;)

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #10 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.

PhilipC

  • Guest
Re: Immediate Tweens
« Reply #11 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).

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Immediate Tweens
« Reply #12 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

PhilipC

  • Guest
Re: Immediate Tweens
« Reply #13 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.

PhilipC

  • Guest
Re: Immediate Tweens
« Reply #14 on: July 03, 2012, 10:31:26 PM »
Should be done just need to do a new release.