[Behavior] LiteTween

  • clrammer

    I know how inconvenient it is for doing things like that, but that is kinda how we should do thing in C2.

    The very first version of LiteTween accepts multiple tween on one behavior, like you can put 'PosTweenA' as tween name and it'll trigger correct OnEnd event respectively. It is neat and I personally liked it, but turns out that it is not easy to grasp that concept to some and it introduces 'hidden properties'. What I mean by hidden properties is those properties you can't see on design sheet, it will be modified on runtime (not very user friendly for artists usually). So the final decision is removing that 'complexity' and let C2 handles that for us.

    I personally do not know the impact or overhead on performance of having so many behaviour on one object.

    How about using a state machine behavior to control the tween, and put relevant code bout it in a code group (to keep event sheet tidy)?

  • lunarray

    Thank you for the response. It all makes sense and I will likely go the state machine behavior route.

    Thanks again for the great behavior!

  • Actually, another question.

    Any ideas on how I can tween the scale of a sprite font? Size doesn't actually change the text size. I need to manipulate the "character scale" attribute of the sprite font.

    My current implementation uses lerp, but of course the allure of the LiteTween behavior is to cut out as much of my lerp code as possible. I really, really like being able to kick off a tween and just wait for the "on end" trigger as opposed to tracking the lerp status every tick :)

    Thanks!

    EDIT: Never mind, I answered my own question by using tween value. That's what it's there for :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello! I'm having some trouble with this behavior that could be just me misinterpreting how it works.

    I'm using it to tween the height of a sprite based on another instance variable, but the resulting height of the sprite does not match up with the target height that I set in the event sheet.

    .capx here: storage.wertle.com/construct2/LiteTweenIssue.capx

    Basically you steer the red block to pick up purple blocks, then go over and drop them in the bucket. Then I tween the meter, setting the target height to be the number of things the bucket contains.

    However, the resulting height of the tween is not the target height, so I'm a little confused as to where it is getting its target height. Please advise!

    (as a side note, I tried to print the LiteTween.Target property and got a js error in Chrome, i left the line in but disabled it if you want to see)

    EDIT: Notice that if you change the tweened property to Size it seems to scale as expected, but if you use Height, it seems to scale up an arbitrary number that is not related to the set target value.

  • Wertle:

    Ah yes, it was my bad, forgot to change the height portion of the code for the tween :( I think this one fixed it, I fixed the litetween to the latest version, can you try it again?

    updated

    PS: also fixed the Target property

  • Hi lunarray

    Is it intended behavior that only the first "On tween end" event is processed if there are multiple on the event sheet for the same tween?

    Thanks!

  • clrammer

    Oh didn't notice that bug earlier, just fixed it. Can you try downloading again and test it?

    LiteTween

  • lunarray

    It works great! Thanks so much for the quick fix. Loving this behavior!

  • lunarray

    Works like a charm! Thank you!

  • Is there a download link for the apple example? I want a ball to squash like that but I don;t know what settings to use.

  • AarongamerX:

    That example is based on the first version of LiteTween, so even if I post the capx here, you won't be able to use it. I made another capx which is kinda the same with that one. And thanks to that I managed to find another bugs that appeared due to a recent change in it.

    Apple Stretch

    @Wertle, clrammer

    Please update the LiteTween, that latest change cause all OnEnd on all LiteTween to always fire when one OnEnd happened. And height tween accepts parameter in form x,y (which should be y only).

  • Thanks for tagging me with that notice!

  • I need to manipulate the "character scale" attribute of the sprite font.

    EDIT: Never mind, I answered my own question by using tween value. That's what it's there for :)

    Hi, i have the same situation, but couldn't figure out how to use tween value.

    Can you please share a capx or something?

    thanks :)

  • icepam

    This is the example of using value tween to control SpriteFont scale

    Example

  • Thanks, this behavior is extremly useful! <img src="smileys/smiley32.gif" border="0" align="middle" />

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