Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Smooth scrolling / panning

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

  • #11, by afrlme 12 years ago Zitieren
    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.
  • #12, by SDMono 12 years ago Zitieren
    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!!!
  • #13, by AkcayKaraazmak 12 years ago Zitieren
    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.
  • #14, by SDMono 12 years ago Zitieren
    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.
  • #15, by afrlme 12 years ago Zitieren
    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.
  • #16, by SDMono 12 years ago Zitieren
    Made a little example. Here is a download link so you can check it out: http://www.filedropper.com/panning_1
  • #17, by SDMono 12 years ago Zitieren
    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.
  • #18, by AkcayKaraazmak 12 years ago Zitieren
    Thats great Mate! works perfectly now I'll try to find a way to use it with mouse scroll grin
  • #19, by AkcayKaraazmak 12 years ago Zitieren
    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!!!
  • #20, by ke4 12 years ago Zitieren
    You can create a new cursor, which is same looking but doesn't have active image and change to this cursor on hover.