Background Scrolling

Started by Terrorcell, Sat 05/04/2008 00:45:56

Previous topic - Next topic

Terrorcell

Does anyone know how to make the screen scroll left, right, up or down when the player moves their mouse to the sides of the screen?
Your help will be greatly appreciated.

Radiant

Code: ags

function repeatedly_execute () {
  if (mouse.x < 10) {
    SetViewportX (GetViewportX () - 1);
  }
}


et cetera.

Terrorcell

Sorry, I should have made it a bit more clearer. What I want is for the player to move their cursor to the edge of the screen and then the screen will scroll until the player moves their cursor away from the edge. But I'm having trouble with that. Whenever I move the cursor away from the edge of the screen after scrolling to the spot I want, I move the cursor back to the edge of the screen and the screen flicks back to the spot where I first started scrolling.
I still can't figure it out.

SMF spam blocked by CleanTalk