[Behavior] LiteTween

Post your completed addons to share with the community

Post » Thu Dec 17, 2015 10:16 pm

@Zebbi
You can set the object origin at the bottom of the sprite (via animation editor > set origin), any height scaling won't affect the sprite's position if you do it that way.
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Fri Dec 18, 2015 12:12 pm

lunarray wrote:@Zebbi
You can set the object origin at the bottom of the sprite (via animation editor > set origin), any height scaling won't affect the sprite's position if you do it that way.

Thanks, I've done that now. Would be to be able to select which origin to tween from, for example, I have some characters resizing their height as they walk (with the origin set to the bottom center), but when they jump and do a somersault, it would be nice if the rotational angle could be set from the centre, rather than the bottom centre, to make it look like a smooth spin.
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Fri Dec 18, 2015 10:33 pm

@Zebbi
Oh, in that case, in construct 2, you can define different origin for every animation or even frame. So you can have center origin for the sommersault animation, while keep using bottom origin for the running, walking and crouching animation. LiteTween would always use the origin instead of ImagePoint, because it is only a behavior attached to something like sprite. The actual rotation is done by the official sprite plugin. It is possible to code LiteTween so that it would override how Sprite rotation behave, but I think it is not good if I override the default rotation provided.
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Fri Dec 18, 2015 11:33 pm

lunarray wrote:@Zebbi
Oh, in that case, in construct 2, you can define different origin for every animation or even frame. So you can have center origin for the sommersault animation, while keep using bottom origin for the running, walking and crouching animation. LiteTween would always use the origin instead of ImagePoint, because it is only a behavior attached to something like sprite. The actual rotation is done by the official sprite plugin. It is possible to code LiteTween so that it would override how Sprite rotation behave, but I think it is not good if I override the default rotation provided.

Yes, but if I change the origin point for the somersault, the character's animation position will jerk up when that plays, and back down again when it stops playing, won't it? I'm also just using the same walk animation at the moment for the somersault since you can't really see it's walking when it's rotating. Could there be a way of setting the origin point to image if needed?
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Sat Dec 19, 2015 1:47 am

@Zebbi
Ah, now i understand what your problem is. I have one trick that might work, without messing up with the javascript SDK, but it probably won't be a clean simple solution like you want. The trick would be making two sprite, and use one for the jumping 'tween' and the other for the height tween. I'll just post the example capx here, maybe you want to take a look.

https://dl.dropboxusercontent.com/u/553 ... rigin.capx
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Sat Dec 19, 2015 5:28 pm

lunarray wrote:@Zebbi
Ah, now i understand what your problem is. I have one trick that might work, without messing up with the javascript SDK, but it probably won't be a clean simple solution like you want. The trick would be making two sprite, and use one for the jumping 'tween' and the other for the height tween. I'll just post the example capx here, maybe you want to take a look.

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


Thanks for that great example, that's a great trick using the opacity, I've got my enemies set-up with containers already so it'll be double the sprites I already have, but this will at least work! Would it screw up the SDK by having optional image points for a future version of litetween?
B
30
S
7
G
3
Posts: 586
Reputation: 4,344

Post » Sun Dec 20, 2015 6:49 am

@Zebbi
It would be so much work and also, it will be a dirty hack to make litetween override the default rotation/angle caveat for all common plugins, even only for Sprite it is already alot of work >.<. I think it is really something that should not be implemented at behavior level.
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Fri Jan 15, 2016 7:59 am

Thanks for the plugin. This is awesome. I am now going through a tutorial that uses the old easetween pug. I see that the properties of easetween is different from litetween. For example, I don't have "Playback Mode" which has for example "Ping Pong Stop". What should I do to get the same effect? Thanks
B
8
S
1
Posts: 12
Reputation: 516

Post » Sat Jan 16, 2016 4:07 am

@mzeid
First thing first, EaseTween's ping pong is different from LiteTween ping pong. So, easetween ping pong works by doing tween back and forth, while litetween pingpong reverse the seek bar of the tween. It is easier to differentiate if you see how they work in practice.

Okay, now for the ping pong stop, you just use ping pong (accessible from the start action), and then add 'On Reverse End' Condition for the sprite (or anything you tween), then put action Sprite.LiteTween.Stop.

In LiteTween you might end up taking more events to control your tween, but in the end, that is how it should be. EaseTween is more comfortable and powerful, but the idea of making LiteTween is to make is more light, and to delegate all the play control to the even sheet.
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Thu Jan 21, 2016 6:12 pm

@lunarray
Thanks lunarray for your reply. I need to play more with both behaviors and see. Thanks again for taking the time to address my question. Appreciate it!
B
8
S
1
Posts: 12
Reputation: 516

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: jkleffel and 0 guests