I'm using C# WinForms to create a level builder for my XNA game. I have a tile grid that you can paint with a Pencil tool, like in MSPaint. The problem is that when you drag the mouse fast(ish) to paint a line tiles get skipped.
I've tried using one approach i saw on Google saying to spawn a thread to do the painting, but that didn't seem to help.
Any ideas?
OTTOMH, you could keep track of the last point the mouse was and in your MouseMove handler you can assume linear motion and determine all the tiles between the last point and the current point. My guess is that you're not likely to ever get enough MouseMove events to fire to handle the case where the user moves his mouse very quickly.
Awesome! worked perfectly.
I used the DDA line algorithm from here
http://www.cs.unc.edu/~mcmillan/comp136/Lecture6/Lines.html
to draw the line.
Thanks!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With