smooth viewport scroll back

Started by Alen101, Thu 31/12/2015 04:44:58

Previous topic - Next topic

Alen101

Hi, im trying to make the camera move lefting the character behind to allow the player to see a landscape and then back to the character.
Rigth now i have this and it run ok on the first part, but when the camera goes back it goes back without scrolling. It jumps to the player position.
How can i make a smooth scroll back like the scrolling on the first part?

Code: ags
SetViewport(0, 134);
while (x<200) 
{
  SetViewport(x,0);
  Wait(1);
   x++; 
}

Gilbert

As you already moved the viewport from x = 0 to 200, why don't you just do the reverse?

Code: ags

x=200;
while (x>=0) 
{
  SetViewport(x,0);
  Wait(1);
   x--; 
}


Alen101

It works great! thank you very much!!!

SMF spam blocked by CleanTalk