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.

Dark GDK / DarkGDK and dbLine

Author
Message
colinkramer18
14
Years of Service
User Offline
Joined: 8th Feb 2010
Location:
Posted: 9th Feb 2010 01:29
Hi, for my C++ class we need to make a simple house and tree using the dbLine function. Is there an easy way to know where to place your coordinates so they will show up correctly instead of just guessing? Thank you and hopefully somebody can help me out.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 9th Feb 2010 02:29
You could dbText(0,0,dbMousePositionX());

Then move your mouse to where you want it. I dont have a copy of the dark gdk command set so i cant tell you the actual commands. But just look them up in the help file.

www.touchofdeathproductions.com
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Feb 2010 04:12
or you could just write a simple drawing program using the dbLine.

One click to start a line, and one click to end the line. While you are drawing the program saves the info in a text file for you, and you could even make the program load the file and render from it instead of hard coding the values.

Erm...all depends.

But there is always math. We know that 0,0 is the top left corner, and the bottom right corner is x,y where x is the screen/window width and y is the height in pixles.

Its pretty simple to get the values for each point on the screen based on points you already use, and such, or by guessing. A vertical line that is 200 long and is 100 pix from the left and bottom edges of the screen would be: [100,(x-300)] & [100,(x-100)] where x=screen height.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 9th Feb 2010 08:13
Here is a basic example I just wrote.
It only took about 10 seconds so it's just for learning



Hope it is of some use.

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Feb 2010 08:24
@Aldur: Awesome. Thats pretty much what I had envisioned. lol.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 9th Feb 2010 08:44
Haha yeah, I read your post and decided to see how easy it was!
Thanks Amn

Login to post a reply

Server time is: 2024-11-20 05:17:14
Your offset time is: 2024-11-20 05:17:14