Vindicator209 Posted May 25, 2008 Posted May 25, 2008 How can I create a line that starts at a specified location to the cursor (as the cursor is moving)? I want to avoid using Guis though, because it will be done constantly... I've seen this done somewhere, but I dont remember where... [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
Muchuchu Posted May 25, 2008 Posted May 25, 2008 So what exactly do you want to do? I know mousegetpos() is most likely the function you want to use though.
Vindicator209 Posted May 25, 2008 Author Posted May 25, 2008 Wellm I want to be able to left-click, then drag my mouse to another position, and have it draw a line between the positions [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
monoceres Posted May 25, 2008 Posted May 25, 2008 Maybe? #include <GDIPlus.au3> #include <misc.au3> HotKeySet("{ESC}", "close") _GDIPlus_Startup() $dc = DllCall("user32.dll", "int", "GetDC", "hwnd", "") $graphic = _GDIPlus_GraphicsCreateFromHDC($dc[0]) Do $pos = MouseGetPos() If _IsPressed("01") Then Do Sleep(10) Until Not _IsPressed("01") $pos2 = MouseGetPos() _GDIPlus_GraphicsDrawLine($graphic, $pos[0], $pos[1], $pos2[0], $pos2[1]) EndIf Sleep(50) Until False Func close() _GDIPlus_GraphicsDispose($graphic) _GDIPlus_Shutdown() Exit EndFunc ;==>close Broken link? PM me and I'll send you the file!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now