Scroll room with out player(SOLVED)

Started by Candle, Thu 10/03/2005 23:01:50

Previous topic - Next topic

Candle

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 .

Ashen

SetViewport (x,y)
GetViewportX ()
GetViewportY ()

E.g.:
Code: ags

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)
I know what you're thinking ... Don't think that.

Candle


SMF spam blocked by CleanTalk