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 / Buttons

Author
Message
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 20th Sep 2009 07:48 Edited at: 13th Oct 2009 14:00
after searching the forums ive noticed people wanting to make menus and they needed buttons so here ya go.



if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 25th Sep 2009 18:09 Edited at: 25th Sep 2009 18:29
That is good only thing I would change is the ints to bools and return true are false. It makes it a little faster.
and add imagecolorkey.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 26th Sep 2009 01:15
yea i noticed that but i didnt feel like changing it since it was effective
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 20:33
So, I'm a bit confused. How do we implant this into a menu picture and add in our own custom buttons? How do we implant it into our game overall?

LOL
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 13th Oct 2009 22:05
You will need to first load 3 images(idle,mouse over, and pressed), then call the MakeButton function which will handle the sprite creation. Then while you loop the menu, call the RunButtons function to handle the actual mouse ect.

next you call IsButtonDown(iButtonID) to handle what the button does, here is an example.



If you still dont understand, I will make a quick example

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 22:36
Well I understand what you mean, I just am not 100% sure where I should put what in my game and so on and so forth. For example, I am not 100% sure where I should put all the code stated in your first post. I have a file called commands.cpp where I make functions and put them in my main (save space and increases efficiency, I think). Is my file, commands.cpp, the home for the code you put on your first post? Basically, all I'm asking for is where do I implant the code. (If you need to see my code/project let me know)

LOL
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 13th Oct 2009 22:41
You can put it anywhere , I have it in a header file called "Buttons.h" then all you have to do is include the file in the file you are going to use it in

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;

Login to post a reply

Server time is: 2024-11-19 06:05:52
Your offset time is: 2024-11-19 06:05:52