Scrolling on a canvas

BlitzMax Forums/MaxGUI Module/Scrolling on a canvas

Brainbox(Posted 2008) [#1]
Can anyone make this code work so that it scrolls smoothly ?
- at the moment it scrolls but it lags




xlsior(Posted 2008) [#2]
What are you trying to accomplish?

It seems to scroll fairly consistently, as long as you keep moving the mouse. Is that how you want it to behave, or should it continue scolling without mouse movement as well?


CS_TBL(Posted 2008) [#3]
The ultimate solution would be a rewrite I'm afraid..

What you want is an event-hooked function or method in a type which updates the map according to a given timer (which is also event-hooked)..


Brainbox(Posted 2008) [#4]
@xlsior

I'm trying to get it so that when the mouse is at the edge of the screen the image scrolls and when the mouse isnt at the edge of the screen it dosent scroll. But I can't get it to scroll smoothly its all jerky.


CS_TBL(Posted 2008) [#5]
Event-hooks and timers are what you want.. really..


jsp(Posted 2008) [#6]
First you could may split the mouse movement and the scrolling.
The mouse move event set the scroll direction and the timer updates the canvas.

try this quick hack:



Brainbox(Posted 2008) [#7]
@JSP
Thankyou. It works!