General Purpose Smooth Scrolling Module

Started by subspark, Sat 01/12/2007 04:12:08

Previous topic - Next topic

Khris

Quote from: subspark on Wed 05/12/2007 07:22:37I want it to scroll 91 pixels to the left.

In that case you have to set c to 91 before the loop, then decrement it inside:

Code: ags
function room_AfterFadeIn()
{
  Wait(80);
  int x;
  int c=91;              // set starting coord
  while (c>=0) {    // end at 0, not 1
    if (c>45) x=Scroll(91, c, 46, eEaseOut);
    else       x=Scroll(45, c, 0, eEaseIn);
    SetViewport(x, 0);
    Wait(1);
    c--;          // decrement c
  }
  Wait(100);
  ReleaseViewport();

  FadeObjectIn_NoBlock(oLocationTime,0, -15); // Paracosmo City 2083
  cNarrator.ChangeRoom(3, 120, 0);
}

subspark

Ahh darn it. I was going to try that but got sidetracked and tried something else.
Thanks a bunch, Khris.

Paul.

Ali

I have just uploaded a module version of the code you linked to on the first post. I don't know how it compares to the code posted by KrisMUC, but it should work without any code in room scripts:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=33142.0


subspark

Fantastic Ali. Congrats.
This will come in handy. I think the addition of smooth scrolling paralax is a necessary one. I'll be more than happy to help you with the paralax layers in your module thread.

Cheers,
Paul.

SMF spam blocked by CleanTalk