Screen Scrolling

Started by metalmario991, Fri 13/03/2015 23:56:10

Previous topic - Next topic

metalmario991

How do I get a screen to scroll to another instead of completely changing the room?

actualwiazrd

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.

monkey0506

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.

SMF spam blocked by CleanTalk