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 / Effective (if not messy) button system.

Author
Message
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 30th Jun 2008 06:08
Well, here's a piece of my code, all the parts you need for the button system.



Ignore the useless comments, please.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Jun 2008 20:18 Edited at: 30th Jun 2008 20:20
See this:


Do this:


[edit] - LOL - Though now I'm thinking there is a bug in there anyways LOL

A bit faster - and with some ingenuity - you can tighten it up more - whether C or C++/OOP styled

[edit2] - No bug - just forgot the + button width thingy.

In short - I'm trying to show ya calling the dbSprite function more than necessary is a waste of CPU.

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 1st Jul 2008 00:34
Well, if it's used the same way I'm using it, it won't be a problem.

It's on my menu, where CPU use is no problem.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 4th Jul 2008 21:19 Edited at: 4th Jul 2008 21:22
I was never a big fan of media for menu systems, so I tend to hard-code generic functions that use basic 2D drawing operations for clean, minimalist feel. My generic button function works like this...


The idea is that no sprites, bitmaps, or images are used, so there is nothing to clean up. The actual usage of this is very simple as well.


I don't know if that would compile out right, because this is an excerpt from a program of mine, but that's the basic idea.


My site, for various stuff that I make.

Login to post a reply

Server time is: 2024-11-20 15:34:06
Your offset time is: 2024-11-20 15:34:06