[Behavior] LiteTween

Post your completed addons to share with the community

Post » Sun Jun 23, 2013 11:18 pm

Had a go with 0.9, still a bit of a problem:

I set the (absolute) target of a sprite to 100, 100 for example. Then I play the tween, so it goes from its initial position to the target. Now I play the tween again, what I then expect it to do is go back to where it was before, then go to the target but what it actually does is...nothing. Even when I seek back to 0, play (from beginning)...nothing happens.

Here's a sample CAPX:
http://www.kenney.nl/tweenSample.capxKenney2013-06-23 23:18:51
B
21
S
2
G
1
Posts: 90
Reputation: 2,146

Post » Mon Jun 24, 2013 12:14 am

@Kenney

Ah, I see, I've checked the capx. You shouldn't be setting target every 1.0 secs (what I exactly mean is that you should set initial beforehand), it will cause the initial to be set everytime you set the target (to object current position).

It goes kinda like this:
1. Before the first tween, the object position is at 302,241.
2. At 1.0 secs, c2 called set target to absolute 100,100. Because of this call, it also set the initial of the tween to 302, 241. So, right now, the tween goes 302,241 to 100,100.
3. The tween plays, and the object is now at 100,100.
4. After another 1.0 secs, c2 called set target 100,100 (absolute) again. But now, the object is already at 100,100. So it make a tween for 100,100 to 100,100 (which does nothing).

The right way to set initial now is simply by setting the object position before you set target. If you add "Set Position to 302,241" before setting the target it will act just like setting initial.

PS: Maybe I should include a capx about it :>
https://dl.dropboxusercontent.com/u/55358831/helping/tweenSample.capxlunarray2013-06-24 00:22:39
B
32
S
5
G
1
Posts: 178
Reputation: 3,501

Post » Mon Jun 24, 2013 12:25 am

Aaaahh! Got you now! Sorry for all the trouble.

I'm used to Flash and tweens work a bit different there (more like I described above), so that's where the confusion started.
B
21
S
2
G
1
Posts: 90
Reputation: 2,146

Post » Mon Jun 24, 2013 12:29 am

Oh and, you can also just play the tween every 1.0 secs, without re-setting the target, it will work kinda the same too.

Just one event, "every 1.0 secs > LiteTween start from beginning". :>
B
32
S
5
G
1
Posts: 178
Reputation: 3,501

Post » Mon Jun 24, 2013 12:39 pm

man, how to use Size?
I just want to make a sprite bigger.
But, it keeps using the number as X coordinates.

thanks.
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Mon Jun 24, 2013 5:07 pm

@California

Something like this?
Size tween
B
32
S
5
G
1
Posts: 178
Reputation: 3,501

Post » Mon Jun 24, 2013 5:24 pm

Looking good Lunarray :), feels more intuitive :)

Anyway you can add also a pure position XY version of the target. Though, maybe it's not needed. However, it would make a fantastic moveto as part of LiteTween :)

Also as a suggestion. If only a single Target X or Y is set. When doing a Start. The system should by default use the current X/Y.

As it is now. I set my sprite by the normal position set(600, 800)
object.litetween.setTarget(X, absolute, 400).
object.litetween.start

What happens is that my object will move to X400, but also go up to Y0. If I'm using only a single position target, I would assume that the other position vector won't be affected.

I'm liking LiteTween a lot :) it's great. I'm sorry, but I'm already using it for production :P so I will have to suffer the changes :D

Also I think keeping the create/inialize version for an entire package version is a good idea. Maybe add a comment that it's a more complex version?jayderyu2013-06-24 17:43:37
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Jun 24, 2013 7:54 pm

Exactly, thanks!
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Mon Jun 24, 2013 9:59 pm

Any way to make it work for textboxes?
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Tue Jun 25, 2013 2:39 am

@lunarray

Some updates. I need to use "Set Tween Proprty" before being able to use SetTarget"

If I use SetTarget and specify any of them. Then by default that should be used. right now I need to
set tween property height
set target height (relative) value

Suggestion
is there a repeat option? once an animation type start. it would be fantastic to have an option for it to continue until otherwise specified.

suggestion
you might want to change "duration" to "animation time". I for some reason thought "duration" was the total length of duration while trying to get an obect to pulse :D

bug
the reported value for duration is {1}, I think it is supposed to be {0}. I don't see the duration amount I see {1}jayderyu2013-06-25 02:48:45
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests