[Behavior] LiteTween

Post your completed addons to share with the community

Post » Wed Oct 26, 2016 2:05 am

gameglaux wrote:@putrandasky
Works fine for me in xdk and cocoon. If it works when you run the layout it should work when you export.


hi gameglaux, thankyou for your respond,

i think i'm using old version of litetween last night.
but after i download with version 1.7, it's work with intek XDK!

thanks
B
22
S
8
G
2
Posts: 5
Reputation: 2,518

Post » Wed Oct 26, 2016 3:20 pm

Hello lunarray, first of all thanks a lot for your plugin!

I have a simple question. I'm using litetween (1.5) to do a simple dodge in a top down a-rpg. Basically when you hit the button, the character moves a bit in the gamepad left axis direction.

What I want to do is simply stopping the movement when I collide with a solid element. To do a collision check, I do a simple event like that
Image

The problem I have is that it doesn't really work, and if the tween is fast enough, it goes through the solid sprite without being stopped.

Is there a more efficient way to do this kind of collision check, compatible with litetween?

Thanks a lot!
B
6
S
2
G
1
Posts: 39
Reputation: 605

Post » Wed Nov 02, 2016 7:55 pm

Sorry for the late reply guys,

@jomo
That is the correct behavior of how EaseInBack, EaseInBounce etc works.
I'll try to explain EaseInBack and EaseOutBack using ordinary words.
So in height tween of EaseOutBack, it works by making its height bigger, then it will exceed 68 pixel, after that it will return to the 68 pixel with.
In height tween of EaseInBack, it starts by making its height smaller, then grow its height bigger until it reach 68 pixel.

But in the case of EaseInBack since it starts at zero, the height became negative, which cause it to turn upside down. This is how C2 behave, if you set height or width to negative value it will flip or mirror (actually that is how it is coded in javascript), so I can't do anything with it. Clamping it to zero in litetween using javascript would make other people who expect it to go negative unsatisfied. So if you still want that effect, you should clamp it to zero in C2 events.
I made a simple example here:

https://dl.dropboxusercontent.com/u/553 ... anged.capx

Are you sure you don't want EaseOutBack instead?
B
36
S
6
G
2
Posts: 190
Reputation: 4,223

Post » Wed Nov 02, 2016 8:06 pm

@Flodcp
I am not sure with that problem, if you have a capx i might be able to help more. But try this first, would changing it from on Collision (which is a trigger), to on Overlap works?

@gameglaux
Changing it to "start, target" would make alot of other users of LiteTween who have used the old way of "target" refused to work (some used really alot of litetween in their old project).
The other way would be to add something like "Value (start,target)" tweened property to take 'start, target' parameter, but this is confusing because it will be inconsistent to how other 'target' works. I am sorry I think I shouldn't add this one. And thank you for answering the question for me about XDK/Cocoon export. :>
B
36
S
6
G
2
Posts: 190
Reputation: 4,223

Post » Thu Nov 03, 2016 12:11 pm

@lunarray yup I think changing it to an overlap seems to work better already, it will help me figure this out, thanks!
B
6
S
2
G
1
Posts: 39
Reputation: 605

Post » Fri Nov 04, 2016 11:40 am

hello,
not my behavior appears. I've copied the folder, restart the program and the computer and is still missing. for what is this?
Thank you
B
6
S
2
Posts: 33
Reputation: 528

Post » Fri Nov 04, 2016 12:07 pm

problem solved

thank you
B
6
S
2
Posts: 33
Reputation: 528

Post » Sat Nov 05, 2016 8:19 am

lunarray wrote:Sorry for the late reply guys,

@jomo
That is the correct behavior of how EaseInBack, EaseInBounce etc works.
I'll try to explain EaseInBack and EaseOutBack using ordinary words.
So in height tween of EaseOutBack, it works by making its height bigger, then it will exceed 68 pixel, after that it will return to the 68 pixel with.
In height tween of EaseInBack, it starts by making its height smaller, then grow its height bigger until it reach 68 pixel.

But in the case of EaseInBack since it starts at zero, the height became negative, which cause it to turn upside down. This is how C2 behave, if you set height or width to negative value it will flip or mirror (actually that is how it is coded in javascript), so I can't do anything with it. Clamping it to zero in litetween using javascript would make other people who expect it to go negative unsatisfied. So if you still want that effect, you should clamp it to zero in C2 events.
I made a simple example here:

https://dl.dropboxusercontent.com/u/553 ... anged.capx

Are you sure you don't want EaseOutBack instead?


Thanks for the reply! But actually it seems we were not talking the same thing. I know negative height will cause flipped image so I use the tween combination intentionally. The problem is when I refresh about 10 times there will be about 4 times to see an upside-down (will see a flipped READY at tween end) image. But, now I changed to r239 and everything is good again. :D
Thanks for your support!
Providence University, lecturer.

Tatung University, lecturer.



Consultant per question: USD$15 / time

Consultant by month: USD$300 / month

Customized project: USD$2500 / capx
B
78
S
18
G
4
Posts: 197
Reputation: 7,828

Post » Mon Nov 14, 2016 11:50 pm

@lunarray I have a question. I'm using "value" for this behavior.

I need to know how to set start value and end value like from 12 to 35. This behavior currently calculates 35 to 0 in loop what I did not want.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Thu Nov 17, 2016 7:07 am

@Joannesalfa

Oh, there is an action 'Set Value' to set the start Value.
On mouse click
> Litetween Set Value = 15
> Litetween Start tween
B
36
S
6
G
2
Posts: 190
Reputation: 4,223

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests