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 / Help with some code please

Author
Message
Dragonslayer
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location: New Lenox Illinois U.S.A.
Posted: 24th Dec 2004 11:32
I'm sure I can do this better, can probably do it with sprites but for now I'm trying to work with text commands so I have two menu items one is Main Menu and the other is Create character and what I want to do is move the mouse over the create character and have it change red and then when it is clicked have it change blue but I'm not sure what commands I need to use.

I have tried a few commands but could not get it working. I left a dbMouseMoveX () command in there that probably is not the right command or in the right spot.
Dragonslayer
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location: New Lenox Illinois U.S.A.
Posted: 24th Dec 2004 12:00 Edited at: 24th Dec 2004 12:05
Anyone??? I changed the and in the if statement to && and the program ran but I just got a blank screen. I also had a warning about the dbInk command in the if statement being an empty control statement.

Ok I had a semi colon at the end of my if statement (oops) now the program runs with no errors but I still get a blank screen and when I go to close the window the system locks up.
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 24th Dec 2004 12:17
I saw the errors you mentioned above, and moved printing to the loop. you have to have the printing in the loop so that every redraw prints to the screen or else it won't show up.... I am looking at getting the colors to chage now, but it is late for me. Give me a little time....

Also, a word of advice, watch your indention. Especially in C/C++ if you indent wildly, it becomes impossible to follow the code....
Dragonslayer
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location: New Lenox Illinois U.S.A.
Posted: 24th Dec 2004 12:22
I understand about the indenting I was going to try what you did next so thanks It's getting late for me to but I'm going to keep at it for a little while. I will check back in a little bit. If I get the color to change I will post it!
Dragonslayer
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location: New Lenox Illinois U.S.A.
Posted: 24th Dec 2004 12:51
Well between me and roujesky This code works I left out the stdio.h
and took out the array, with those two lines in the program it would lock up when run. I still have not figured how to get the create character menu item to turn red when the mouse is run over it.

any ideas welcome thanks
Dragonslayer
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 24th Dec 2004 13:19
aving a brain burp here, but I am stuck on tangent here. I want to see the mouse position on the screen but it continously overwrites instead of clearing and then displaying....

Once I see the mouse position when the mouse is over the text we can make this beast work.

Something else that nags me is a question i posed in this forum about getting an object to follow the cursor. I don't know if it pertains to this, but there was required a transform from 3d coords to 2d coords.... You might wnt to look at that thread also.
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 24th Dec 2004 13:22
forgot to add my code....
Dragonslayer
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location: New Lenox Illinois U.S.A.
Posted: 24th Dec 2004 22:40
Still need some help here. Does anyone know the code to get text to change color when the mouse moves over it?
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 25th Dec 2004 00:07
OK, I have some of what you want. I loaded an image in the background so I can see my x and y positions display.... all I am checking is y position of the mouse. you can also add code to check x position in addition.

I spent some time spinning my wheels trying to understand why my x and y positions just overwrote, and did not clear then write. I decided to put an image on the background to cause a redraw which helped see my 'debug' statements....

I am pretty good at c/c++, but a noob at DGSDK

Hope this helps. Happy holidays and I am off to family to stuff my self sick

Login to post a reply

Server time is: 2024-11-22 13:51:44
Your offset time is: 2024-11-22 13:51:44