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 / Decent Gui Functions (DBP)

Author
Message
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 2nd Jan 2007 07:26 Edited at: 12th Jul 2007 22:33
See this WIP


This has changed a lot since the original. It no longer uses bitmap fonts, but now it relys on Cloggy's d3d_func v3 dll.

Working:
Windows
Buttons
Scrollbars
Statusbars
Listboxes
Checkboxes
Option buttons
Inputboxes

Planned:
Combobox
Menu System (eventually)

Questions:
Should I put a prefix in front of every function to keep it from interfering with your functions, or would this make them annoyingly long? (ex. "window_create" would become "sui_window_create")
Should I seperate the inputbox into two objects? One which is for single line input and scrolls across with the cursor and one which is multi line and has a built in scrollbar like the listbox.

Screenshots:
I'm in need of in-game screen shots, so these will have to do for now.



Still working on this game:


Here is the download.
Here

Here is an example.


JosephB
17
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 2nd Jan 2007 13:52
Very nice and helpful. Thank you. I could not use 'bmp' as a constant, so changed those references to bmps.
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 7th Jan 2007 06:14
interesting remarking as well mate. kudos.

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 11th Jan 2007 03:08
Thanks for the compliments.

I am considering changing my gui back to regular fonts instead of using bitmap fonts. It doesn't seem to look very good when everything is in bitmap fonts, and bitmap fonts don't seem to look great with smaller text anyway. Do people agree with me on this?

JosephB
17
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 11th Jan 2007 10:55
Yes, the regular fonts would look "sharper". However, the bitmaps could add to the feel of the game depending on what someone is using the GUI functions for as it might add a nice effect in the game.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 11th Jan 2007 20:06
Nice to see my fonts being put to good use, but to be honest I think that a normal font would look better in this case

Thanks for crediting me in your code. It wasn't neccessary but I appreciate it. I would appreciate it a little more if you spelled my name correctly though

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 11th Jan 2007 23:38 Edited at: 21st Jan 2007 07:50
Wow, only one person I gave credit to and I spelt their name wrong. Sorry about that. I have changed it, not because I felt I had to but because I felt stupid with it spelt wrong once I knew it.

Well, I'm going to change it back to regular fonts anyway. Bitmap fonts looked good on paper.

Edit:
No more bitmap fonts (and so can work without any media)
-"Click He" problem resolved itself due to this.
The "x" in the corner is an image, therefore looks better.



Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 21st Jan 2007 07:50 Edited at: 27th Apr 2007 23:07
I can't fit all the code into one post, so the functions are attached in a text file. The code does not use any media.

Updates:
Simple listbox has been added
Old scrollbar renamed statusbar
New scrollbar- more suitable for later implemenation

Fixes
Options and checkboxes can no longer be selected through windows

To-do:
Give listboxes and later inputboxes scrollbars
Allow user to select something from listbox
Make the statusbar update faster
Allow the same type of object to have different formatting
Allow menus!

Example:

---------------------------------------------------------------------------------------------------------------------------------------------Download the functions.

Attachments

Login to view attachments
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 16th Apr 2007 00:19 Edited at: 16th Apr 2007 00:43
To convince you to take the time to download the text file I am posting a screen shot of what the example should look like.



Tell me if you have any problems with my functions.

Attachments

Login to view attachments
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 16th Apr 2007 01:04
This is incredible! Well done mate!

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 27th Apr 2007 23:06 Edited at: 29th May 2007 23:53

Thanks. I started making this when I saw your functions, although I had made failed attempts before. Your VUI looks interesting. What are "gadgets" which you mention in that thread? Do they require a dll? I will have to look that up.

Listbox now has automatic scrollbar...
Hide/Show functions made for every object...

The functions are attached again, they are too long.
Here is the new example....



Attachments

Login to view attachments
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Apr 2007 23:22
A gadget is simply like an object. Mine didn't use gadgets, because I'd never heard of them, but they turn out to be pretty useful, because using gadgets means you can have parents and children, which is useful, because, for example, I can make a tab, and put buttons on it with the tab as the parent, then it will position itself relativelly to the tab, and when the tab is hidden/deleted, so will the button.

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 29th May 2007 22:35 Edited at: 16th Jun 2007 04:37
I've updated it so that now objects of the same kind can have different formatting. It works kind of like css. You define a formatting class then assign objects to this class to give it that formatting. The default formatting looks like I have made everything look before hand. Here, this example should show it better than I can explain it.



The updated functions are attached in a text file. They are too long to fit in the post.

Also, I'm interested in what people think I should add to it next. The things I am considering are:
-Making the entire gui use Cloggy's Dll. This will make it go faster but essentially look the same.
-Update inputboxes to automatically have a scrollbar like listboxes already have.
-Create drop down menus.
-Allow objects other than buttons to use loaded images. For example, a window could be made from a title bar image, a body section image, and a close button image. This should allow for shiny looking guis but they wouldn't actually do anything more than this current version.


Edit:
Newest Version ~See, this is what I meant at the top. I will move this text next time I update my code.

Click on my sig and go to the SUI page for the latest version of this. No one seems to be interested in this... there's too many other options. O well, I'll probably keep updating the site.

Attachments

Login to view attachments
alucart13
16
Years of Service
User Offline
Joined: 16th Jun 2007
Location:
Posted: 18th Jun 2007 22:46
sorry mate, doesnt compile for me.. it keeps giving error.

Great work though.

Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 8th Jul 2007 04:15 Edited at: 8th Jul 2007 04:16
@alucart13
Could you try SUI version 1.20 to see if you have the same problem? I just updated my website so that should be what is up there.

If you get the same error could you tell me if it is giving you a line number for the error (and what IDE you are using- if it's the default one the line number would probably be wrong.)?

Login to post a reply

Server time is: 2024-03-29 15:28:35
Your offset time is: 2024-03-29 15:28:35