[Behavior] LiteTween

From the Asset Store
Skin it
$20 USD
A skin plugin and behavior to add a skin system in your game.
  • Added a little change for ppl who got frustated with always having to 'set target' when starting tween. Download on the first page.

    Explanation about the frustration:

    1. Say we have an apple sprite on coordinate (50,50) with Litetween behaviour and DragDrop on it.

    2. We set target to x: 100 relative and y: relative on the "On Layout Start" condition.

    3. When apple is mouse right-clicked, we set it to start the tween.

    What supposed to happen for MOST people:

    Apple dragged to 100, 100 using dragdrop

    Apple right clicked

    Apple moves to 200, 200

    What really happened:

    Apple dragged to 100, 100 using dragdrop

    Apple right clicked

    Apple teleports to 50,50 then moves to 150,150

    How to fix it in the old litetween:

    Do not set target x:100, y:100 in the start layout, force target recalculation on the On Right mouse click, just before starting tween.

    Some people complains to me about this. This is not a bug, but a rather poor design due to my inconclusiveness -.- (sorry).

    So, I added a little fix on the litetween, when you are starting tween, you can force recalculation using the new option, the default is the old litetween behaviour.

    PS: For people who are affected by this, I hope you guys can give me input about how I should tackle this.

  • First off, thank you! This is an essential function and I could hardly use C2 without it.

    Second, I think I found a bug when working with mirrored or flipped sprites. Moving or scaling them with LiteTween un-does the flip or mirror. Is there any way around this?

    Example attached.

    Thanks!

  • TrickyWidget

    Ok, this one should have fixed it, the scale tween vs mirror and flip.

    Could you explain the bug about 'Moving' with LiteTween undoing flip/mirror? The code on the position tween have nothing to do with Height or Width, so it shouldn't even affect anything about scale.

    PS: Download on the first page like usual

  • Ok, this one should have fixed it, the scale tween vs mirror and flip.

    Wonderful, thank you!

    Could you explain the bug about 'Moving' with LiteTween undoing flip/mirror? The code on the position tween have nothing to do with Height or Width, so it shouldn't even affect anything about scale.

    Ah, my mistake! Looking back over my code, the moving I was thinking of also involved scaling. So it seems that was the whole thing. Sorry for the trouble.

    Thanks again for your great work!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello there, very useful plugin. I think it could be the great plugin for construct 2. Currently iam trying to make some menu with some tween movement on some buttons, when i tried to touching button (not touched button), i want the button getting more bigger (i set start scale), and when i relased it, the button getting normal scale. But what i got when i touching the button is the button continuesly grow and grow unless i released it.

    Its me or its a bug? thank you very much

  • lunarray

    Wow.. looks simple, when I tried to change the object mouse to touching and it works. I really confident to make menu with some tween transition on every button, very useful behavior! Thank you...!

  • lunarray

    EDIT: i am sorry to bother you again, when i see your demo apple (LiteTween Stretch Demo (spam click on the right apple), i really don't have idea how to make the apple stretched, would you share the capx file? because i don't see capx file in the first page

  • Hi there I downloaded the files put them in the plugin folder fired up easetwee ref capx. When C2 boot up, window appears with message "litetween isnt installed - (long story short)" I use r 173 release, am I did something wrong?

  • Jantaaa : did you put the plugin in the behavior directory?

  • First off, great work on Litetween.

    I was wondering if there was a way to take advantage of the elastic tween but make the target the original size? Kind of give the sprite a gelatin effect where if would spike and then settle to its original form. Any help is appreciated. Thanks.

    -Ben

  • Jantaaa : did you put the plugin in the behavior directory?

    Sorry I meant Behaviors folder, I find the issue. I had it in the folder of older Construct2 version, silly me

  • sman118

    You can put all bouncies into a family, and make events for that, like the one on the apple example. That is if you just need to do bounce animation for sprites. I think several posts earlier i just post the apple's capx somewhere.

    But, If you really want to make it bouncy using elastic tween without multiple tween, you would need to write a custom tween function and implement it into litetween.

  • Hello again, lunarray . <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I'm still using LiteTween to great success. Thank you!

    However, I've encountered a bug. When attempting to tween the scale on a sprite font, it gives this error:

    [quote:3s3esi5v]Javascript error!

    TypeError: this.inst.curFrame is undefined

    http://192.168.1.2:50001/lunarray_LiteTween_behavior.js, line 321 (col undefined)

    I'm guessing this might be because scale on sprite fonts is applied only to the text and is independent of the overall size of the instance. So there are two different scales involved.

    For my own use, having one tween value applied to both the text scale and the instance scale would be fine. So far I always want to change both at the same time and at the same scale. However, it would be more robust to have the two different scales available to tween independently. Or if you wanted to go all the way, you could have three scale options for sprite fonts; one for the text, one for the instance, and one that does both. However you see fit. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Thanks again!

    Example attached.

  • TrickyWidget

    I'm not really sure how I should tackle this one. I could just put a check 'if this is a spritefont' then i'll tween the characterScale instead of tweening the instance size. However, this is not a very good solution, because then I should also tackle all other plugin type like text, etc.

    About adding three scale options for litetween, that would make it more complicated, I really don't want people sets up more and more option when they are doing tween. LiteTween was meant to be simple and essential, adding more and more settings and feature will really bloat this in no time. For now I think I would just leave it out for now and go revisit this later on.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)