[.net] [C#] Timer for continuous updating?

Started by
0 comments, last by benryves 16 years, 6 months ago
I'm writing an editor of sorts, and I am able to move the view with the mouse. The problem is that I'm not sure how to get it to move continually. Since the view is 2d and will only be made up of geometric shapes and text, there's no need to continually update everything, not will I need to continually draw everything. Rather, only when something changes. But when moving the view around, I have it set so clicking and dragging the mouse will create a vector (direction and length) that the view will move along, as long as the mouse button is held down. But the way the code is now, it only moves the view when the mouse does because I only update the movement in the update function, which is only called when a change is made (which includes the user moving the mouse). Should I create a Timer object and use the 'Tick' event? How else should I get this continuous updating?
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Advertisement
The usual trick for continuous updating is to handle the Application.Idle event rather than a timer.

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

This topic is closed to new replies.

Advertisement