Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: metalmario991 on Fri 13/03/2015 23:56:10

Title: Screen Scrolling
Post by: metalmario991 on Fri 13/03/2015 23:56:10
How do I get a screen to scroll to another instead of completely changing the room?
Title: Re: Screen Scrolling
Post by: actualwiazrd on Sat 14/03/2015 03:04:04
Expand the background graphic to a bit over double the width(or height) that you wish to scroll to? Then use that half as if it were a separate room.
Title: Re: Screen Scrolling
Post by: monkey0506 on Sat 14/03/2015 06:33:15
The manual refers to this as the "viewport" of the room. If the room is wider than the game resolution, then the "camera" will automatically pan to follow the player character as they walk around the screen. For more precise control, you can use the SetViewport function. You may also have your room scroll up and down by having the room taller than the game resolution.

Example:

Game resolution is 800x600, room size is 1280x600. This room will scroll left and right.

Game resolution is 320x240, room size is 320x900. This room will scroll up and down.

As stated in the manual entry for SetViewport, you can call ReleaseViewport to allow the automatic panning to resume.