Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Thu 10/03/2005 23:01:50

Title: Scroll room with out player(SOLVED)
Post by: Candle on Thu 10/03/2005 23:01:50
I was wondering how you could scroll the room to the right or left when you have a big room like 640x1000 with out a char moving around and just the mouse .
Title: Re: Scroll room with out player
Post by: Ashen on Thu 10/03/2005 23:17:16
SetViewport (x,y)
GetViewportX ()
GetViewportY ()

E.g.:

if (mouse.y > 180) { // cursor is within 20 pixels of bottom of screen (320x200/640x400)
  SetViewport (GetViewportX (), GetViewportY () + 1);
}
else if (mouse.y < 20) { // cursor is within 20 pixels of top of screen (320x200/640x400)
  SetViewport (GetViewportX (), GetViewportY () - 1);
}

(and so on for scrolling left/right)
Title: Re: Scroll room with out player
Post by: Candle on Fri 11/03/2005 00:29:44
Thanks ..