SetViewport (int x, int y)
Locks the screen viewport to having the top-left hand corner at (X,Y) in
a scrolling room. This allows you to manually pan across a scrolling room
or to have the screen follow a non-player character.
The lock is released when you either call ReleaseViewport or the player
changes rooms.
NOTE: The co-ordinates supplied are 320x200-scale co-ordinates, and will
be automatically multiplied up by the engine.
NOTE: This function has no effect if the current room isn't a scrolling room.
Example:
int ypos = 0;
while (ypos < 60) {
SetViewport(0, ypos);
Wait(1);
ypos++;
}
ReleaseViewport();
will scroll the screen down from the top 60 pixels, then release it back
to follow the player around.
See Also: GetViewportX, GetViewportY, ReleaseViewport
|