scrolling with slow return (SOLVED)

Started by croquetasesina, Fri 22/03/2019 17:32:15

Previous topic - Next topic

croquetasesina

I want to do a scrolling in a room, using

Code: ags

int x;
 while (x<250) {
   SetViewport(x,0);
   x++;
   Wait(1);
}
ReleaseViewport();


But when the scrolling finish, return to the start position quickly in a jump. I would like to make the return slowly. Is it possible?

Crimson Wizard

Just make the same going opposite way?

Either remember where it was by saving viewport position in a variable, or use player.x for the reference.

croquetasesina

Thanks to Crimson_Wizard I got to do what I was trying with the following code


Code: ags

int x;
while (x<250) {
   SetViewport(x,0);
   x++;
   Wait(1);
}
Wait(50);
while (x>0) {
   SetViewport(x,0);
   x--;
   Wait(1);
}
ReleaseViewport();



SMF spam blocked by CleanTalk