Menu
Login
Language
DE EN FR ES IT CZ
Back

Smooth scrolling / panning

  • #10, by SDMono Sunday, 07. September 2014, 18:27 12 years ago Quote
    Would there be a way of changing the scrollspeed via LUA "game:setValue(VGameScrollSpeed, 200)" and increase it while the scrolling is going on?

    Forum Fan

    148 Posts

  • #11, by afrlme Sunday, 07. September 2014, 19:38 12 years ago Quote
    The tween function is not affected by the speed value. It is affected by the delay value. Try changing the easing values & see what happens.

    Some of them start slow, speed up & then slow back down towards the end. For example: easeQuintInOut would slowly build up speed & then slowly decrease speed towards second half of the delay.

    Imperator

    7290 Posts

  • #12, by SDMono Monday, 08. September 2014, 16:55 12 years ago Quote
    In the end I am going to use something like this: "startObjectTween(game,VGameScrollPosition,game:getPoint(VGameScrollPosition),{x=180,y=0}, 2500, easeQuintOut)" in an action area and let the screen pan to the leave or the right depending on the character entering or leaving the action area. It's really smooth. It messed up some of the displayed text when starting a new game because it had stored the scroll information. I fix that problem by resetting the the ScrollPosition to x=0,y=0 executing a script At end of scene. grin

    Thanks Lee for the line of script!!!

    Forum Fan

    148 Posts

  • #13, by AkcayKaraazmak Monday, 08. September 2014, 17:42 12 years ago Quote
    Hey Gordon,

    How we can also make the scene scroll with the mouse move mate? When character goes and also if character stays but when user moves the mouse to the edge of scene.

    I entered your code; startObjectTween(game,VGameScrollPosition,game:getPoint(VGameScrollPosition),{x=180,y=0}, 2500, easeQuintOut) in the action of " at begining of scene " action but nothing is happening when I move the mouse to the edges.

    Great Poster

    442 Posts

  • #14, by SDMono Monday, 08. September 2014, 20:20 12 years ago Quote
    Hmm... I am not using the option for scroll with the mouse in my game. But you are right... when I activate the option "Scroll scene if cursor is at the screen edge" it won't let me scroll.

    Forum Fan

    148 Posts

  • #15, by afrlme Tuesday, 09. September 2014, 02:57 12 years ago Quote
    Simon gave me the scroll position start object tween code.

    If it's not scrolling then it could be a bug I suppose? I can't say I've bothered testing that function since 3.7.1.

    Imperator

    7290 Posts

  • #16, by SDMono Tuesday, 09. September 2014, 05:25 12 years ago Quote
    Made a little example. Here is a download link so you can check it out: http://www.filedropper.com/panning_1

    Forum Fan

    148 Posts

  • #17, by SDMono Tuesday, 09. September 2014, 05:32 12 years ago Quote
    Is there a code to stop the object tween? Maybe that would fix the mouse bug. It doesn't bother me because I am not using the mouse scroll but maybe someone else needs a fix.

    Forum Fan

    148 Posts

  • #18, by AkcayKaraazmak Tuesday, 09. September 2014, 10:16 12 years ago Quote
    Thats great Mate! works perfectly now I'll try to find a way to use it with mouse scroll grin

    Great Poster

    442 Posts

  • #19, by AkcayKaraazmak Tuesday, 09. September 2014, 11:16 12 years ago Quote
    Hey Gordon, mate your code has worked perfectly. I made a object in a scene without image and I used the logic that you used on action areas. And when you move the mouse it does the smooth panning. Only thing for me needs to be fixed is not let cursor to changed. Because I dont want the cursor to see it as an object.

    Thank you again mate!!!

    Great Poster

    442 Posts

  • #20, by ke4 Tuesday, 09. September 2014, 11:26 12 years ago Quote
    You can create a new cursor, which is same looking but doesn't have active image and change to this cursor on hover.

    Key Killer

    810 Posts