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.

Code Snippets / Button Handler - DBPro

Author
Message
NinJA999
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 14th Jun 2007 18:43
Here's some simple code for adding buttons to your program. It allows you to create lots of different buttons, customizing everything from the colors to the font, and it will do the handling for you.

The project is attached, but here is the main program code:



and here's the IMPORTANT FILE buttons.dba:



Though I have had DBC for a number of years, I just got DBPro, so this is my first contribution in DBPro. Hope you like it!

42
http://www.nictitatingrabbit.com
http://penchantpages.nictitatingrabbit.com

Attachments

Login to view attachments
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 14th Jun 2007 19:43
Well done.. you could try to add a 3D effect with different colors for each border (or maybe just the top and left border lighter, and the other two borders darker.. like on windows buttons ).
But I think you shouldn't use different fonts in a realtime-application because it slows dark basic pro down very much..
Good job.

Visit the DBPro - Speed up your game-Thread. http://forum.thegamecreators.com/?m=forum_view&t=88661&b=1
Kyhoshi
18
Years of Service
User Offline
Joined: 21st Jun 2006
Location: Somewhere over the rainbow.
Posted: 16th Jun 2007 06:38
Looks Very nice, but maybe they could be actually made of 3d plains, 2d slows down a 3d game like a kevlar vest does a bullet...

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
NinJA999
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 16th Jun 2007 06:49
True, but think about using this before the 3d part starts. easier to init.

42
http://www.nictitatingrabbit.com
http://penchantpages.nictitatingrabbit.com
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 16th Jun 2007 14:12
Do you mean sprites, or real textured plains Kyhoshi?

Visit the DBPro - Speed up your game-Thread. http://forum.thegamecreators.com/?m=forum_view&t=88661&b=1
vibe runner
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: The Future
Posted: 19th Jun 2007 13:36
I think Kyhoshi means what he says, 2D slows down a 3D game like a baby in treacle. The buttons are text commands. That is not suitable for a 3D game. Kyhoshi suggested 3D plains. He didn't suggest sprites, but I guess that might be okay because sprites actually are 3D objects.
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 19th Jun 2007 15:33
Yes, i just thought that sprites are kind of textured 3D-plains... and I think sprites are easier to handle as buttons than 3D-plains, because of texture, position, size etc.

Visit the DBPro - Speed up your game-Thread. http://forum.thegamecreators.com/?m=forum_view&t=88661&b=1

Login to post a reply

Server time is: 2024-11-22 18:23:01
Your offset time is: 2024-11-22 18:23:01