[Behavior] LiteTween

  • I have 2 intro screens the same size at identical position covering the whole stage. I want to move up -400 px on a click event.

    Active on Start is No for both.

    Needed behavior:

    1 - intro screen - on click event on introScreen, the introScreen moves y -400

    2- intro is now out of screen.

    3 - helpScreen - on click event on helpScreen, helpScreen moves up -400

    4- regular stage is revealed.

    The problem is that the click event on the introScreen starts both the introScreen and the helpScreen.

    I have on the event sheet:

    event

    mouse - on left button Clicked on intro

    Actions

    intro - LiteTween Set target Y(absolute) to -400

    intro - LiteTween Set target Y(absolute) to 300

    intro - LiteTween Start from beginning ( force use current is Start from last recorded)

    event

    mouse - on left button Clicked on help

    Actions

    help - LiteTween Set target Y(absolute) to -400

    help - LiteTween Set target Y(absolute) to 300

    help - LiteTween Start from beginning ( force use current is Start from last recorded)

    What am I doing wrong?

  • resdesign

    Left button click fire for all overlapping sprite, in this case when you click on intro, the help below are clicked also eventhough it is being obscured by the intro. That is why both event fired up. You have to keep track of the current state of the UI and handle only the click accordingly.

  • lunarray Hey can you please re-upload? Download links not working anymore Thanks!

  • Allardje I was able to open both links. May be blocked on your end. Maybe try a different browser.

  • blackhornet Ah i see, works in Firefox. What's up with this adBlock making trouble with dropbox links lately.. Weird..

    Anyways gonna try the plugin !

    Edit: This is awesome! Works like a charm Exactly what i needed. Thanks!

    Edit 2: Just came back to say this is awesome again. This really is freaking amazing! If i only knew before this behavior existed! This is really a game changer and i can finally fine-tune my app to a nice looking piece of art .

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • resdesign

    Left button click fire for all overlapping sprite, in this case when you click on intro, the help below are clicked also eventhough it is being obscured by the intro. That is why both event fired up. You have to keep track of the current state of the UI and handle only the click accordingly.

    Do you mean I need to add a variable and check it?

  • resdesign

    Adding variable is one of the best and recommended way to do it (tracking state), or you can use LiteTween's progress state as a trick too.

    This is one simple example using LiteTween progress state. I wouldn't recommend using it for a more complex screen flow where you have branches, etc though.

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

    If you want to do it with the proper way, it is better to use a state machine, or a variable to track that state. But that example works for simpler cases.

  • le Canapin

    I don't have time to test it yet, but i have a guess about it. Maybe it happened when the first angle is a bigger number than the target angle. For example, tweening from 245 to 15? It is better to add 360 to the 15 if the target value is bigger from the source value. Could you test it and tell me how it goes?

    Hi

    Using blackhornet's method, the value decreases correctly from big to low values, so if my sprite is at 359° and I click so it is 1°, litetween goes from 359 to 1 instead taking the shortest path.

  • Is there any way to get the progress of tween in system expression?

  • Herks

    You can use Sprite.LiteTween.Progress expression for that.

  • Herks

    You can use Sprite.LiteTween.Progress expression for that.

    Thanks, that's just what I needed.

  • Awesome plugin.

    Just one question, every new layout the setting of behavior always change to the default, so when i have many layout i need to setting up one by one. Can we just setup one layout and other layout will keep setting?

    EDIT: I got it. Just solved the problem. Thank you

  • How do I install this? When I unzip it's a bunch of "JscriptScript" files. Tried copying those to the construct 2 folder and didn't seem to do anything

  • You drag the whole lunarray.litetween folder to the C2 behaviours directory (similar to all of the other behaviours there).

  • Is there a way to reduce the wobble on elastic out? I understand it's based on distance, but I'd like my objects to come into the screen and have a slight wobble upon reaching their destination.

    At the moment they almost fly right of the screen again. Can I "tighten" that elastic band?

    Also, when I have them at their destination, and then I change it, they smoothly travel to their destination with no wobble. However, when I tell them to go back to the previous destination, they're all wobbly again.

    Not fully grasping this plugin.

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