Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Grids- can anyone help?

Author
Message
Data
21
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 6th Oct 2006 04:12
I have a question...does anyone know how I can create a grid on Darkbasic using the only '|' and '_' keys on the keyboard?The hardest part about this is that I want the grid squares to be 30*30 pixels and be numbe rform 1 to whatever number there ends up being as so the computer can return the number of the grid square the mouse is in. I've tried to find this elsewhere but honestly I couldn't find anything, could anyone help me out?

Free sigs, email addresses and contests!
JimmyR.Co.Uk
Lukas W
22
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 6th Oct 2006 11:41 Edited at: 6th Oct 2006 11:44
this method is quite slow on my computer but it gives you the idea of how it could be done. (if this is what you mean)



edit,
if you remove "Line x, y, x, y+30 : `| : left" and "Line x, y, x+30, y : ` - : top" it gets a bit faster.

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Oct 2006 20:04
You don't need to redraw the table every time. Just make it one time, get an image of it, and display that one every time:


it's much faster.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Bluestar4
20
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 8th Oct 2006 18:19
hmmm, I have a suggestion to speed it up a little -
first, use the sync on command so that the screen will refresh when you tell it to.
secondly all you need to do is use line command inside a couple loops , after the loops are completed use the sync command.
lastly, the mouse you can figure out on your own .

Data
21
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 9th Oct 2006 03:08
thanks guys thats what I was looking for

Free sigs, email addresses and contests!
JimmyR.Co.Uk
Sonic 91 Software
21
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 10th Oct 2006 01:08
Quote: "It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve."
(sven b's signature)

in my case, it's have a problem, fiddle around, and buy a new computer to solve the problem, 'cause I fiddled too much with the last one. And then the whole process repeats itself...

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12

Login to post a reply

Server time is: 2026-07-07 05:38:23
Your offset time is: 2026-07-07 05:38:23