-
Apr 11th, 2021, 08:37 AM
#1
Thread Starter
New Member
Help with tables
So I'm making the mouse move to specific coordinates to draw an image for me. It takes alot of time to type all off the coordinates in like this:
moveCursor(140, 204)
moveCursor(123, 193)
moveCursor(99, 189)
moveCursor(74, 196)
moveCursor(58, 213)
moveCursor(49, 237)
moveCursor(52, 261)
moveCursor(65, 279)
moveCursor(86, 292)
moveCursor(113, 295)
moveCursor(135, 282)
So I thought that I could make a table and it would do this automatic?
-
Apr 11th, 2021, 08:44 AM
#2
Re: Help with tables
Supposing you're using VB.Net and GDI+, you can create a Point array and use the Graphics objects' .DrawLines method...
Dim points() As Point = New Point(){New Point(140, 204), New Point(123, 193), ... etc.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 11th, 2021, 08:52 AM
#3
Thread Starter
New Member
Re: Help with tables
For exampel if I have alot of coordinates to type in can't I just paste them in a table and a loop runs through all of the coordinates so I don't have to type them all in like this:
moveCursor(140, 204)
moveCursor(123, 193)
moveCursor(99, 189)
-
Apr 11th, 2021, 01:47 PM
#4
Re: Help with tables
Which version of VB are you using? Can you post your actual drawing code?, because none of what you have posted makes any sense in VB.Net
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 11th, 2021, 02:09 PM
#5
Re: Help with tables
put all your coordinates in the correct order in a text file, read that text file into a list(of point) and then create a loop :
Code:
for each pt as point in list_of_points
moveCursor(pt.X, pt.Y)
next
if you want only part of the list, you can play with a "for i" loop and the index in the list
Code:
for i= 5 to 10
moveCursor( list_of_points(i).X,list_of_points(i).Y)
next
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|