PDA

View Full Version : Newbie Question. Drawing a Line with the mouse



Antonio Gonzalez
12-14-2010, 08:37 AM
Hi.
I've used the Search function but found nothing...
Strange, since I got a really Basic Question, I would think this has been asked and aswered already.

I'm using the mouse, and I want to Draw a line on the screen as the Mouse moves on a 2d plane.
Now, I can the the coordinates as I click in the screen (so one can start Drawing) and I can follow the coordinates as I move the mouse in screen with the button pressed.

Now, How Can I draw a line? a pencil-like tool.
Everything I've been using so far doesn't work, It only paints the last Pixel on the Screen (when I stop pushing the mouse)

Is there a coded function?
Thanks in Advance.

Neomex01
12-14-2010, 09:54 AM
when clicking once, get and save mouse coordinates, now click in other place, so now you know where are your 2 points, so youcan paint line

Antonio Gonzalez
12-14-2010, 10:43 AM
Thanks, yeah, I managed to do it.

I mean, It was staring me at the face, but as many problems when coding, I was oblivious to it.