The Daily Click ::. Forums ::. Klik Coding Help ::. scrolling with the mouse
 

Post Reply  Post Oekaki 
 

Posted By Message

:JULI@N:



Registered
  14/07/2002
Points
  641
15th April, 2004 at 18:47:08 -

if i use an invisible active object and set its pos to XMOUSE and YMOUSE and make the screen center that object, well, it just goes too fast, and it's no good.
which is a better way?
it occurs to me to scroll a bit the screen while the mouse is in the edge of the screen, but i really dunno whow to make it...

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
15th April, 2004 at 18:56:07 -

You need 4 events:

Xmouse <= X Left Frame + 16
- Center H Pos: X Left Frame + 320 + 2

Xmouse >= X Right Frame - 16
- Center H Pos: X Left Frame + 320 - 2

Ymouse >= Y Bottom Frame - 16
- Center V Pos: Y Top Frame + 240 + 2

Ymouse <= Y Top Frame + 16
- Center V Pos: Y Top Frame + 240 - 2

That will scroll you 100 pixels in any direction every second. You have to alter the 320/240 to half your game's resolution.

Image Edited by the Author.

 
Kramy

:JULI@N:



Registered
  14/07/2002
Points
  641
15th April, 2004 at 19:07:58 -

thank you very much, you rock


though you posted wrong the right-left scrollings, they were reversed, but nevermind, i got it to work fine

Image Edited by the Author.

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
15th April, 2004 at 22:46:37 -

Ooops, my bad. Should've tested what I wrote before posting.

 
Kramy
   

Post Reply



 



Advertisement

Worth A Click