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 / [DBP] Several GUI Objects

Author
Message
Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 2nd Jan 2008 21:47 Edited at: 3rd Mar 2008 23:07
I developed several GUI objects over the course of several months as their presence became necessary.

You will need:
IanM's Utility and Array Plugin


Debug
Notes: This is here for the same reason as 'system' and 'gamestate'. It is used to display messages on the screen that can be useful when debugging an application.


System
Notes: This is here for the same reason as 'gamestate'. All of the following things depend on it. There is various useful functions in this.


Gamestate
Notes: This might be useful to some people, but the reason I put it here is because a lot of the following items depend on this. For the following objects, there is typically a function such as 'button_setGamestate' that will cause the item to automatically show the item only if the gamestate is equal to it.


Button
Notes: The picture should be 4 equally sized graphics. From left to right, they should be: regular, over, down, disabled.

Example:


Meter (Slider)
Notes: This one uses 2 separate images. The second one is the part that moves. The first is the part that the second image moves along horizontally.

Example:


Checkbox
Notes: The graphic is setup very similar to the button.

Example:


Textbox
Notes: No graphic is required. Wraps lines correctly. Has scrolling (use a button to increase and decrease scroll value). 'redrawfreq' is how often to redraw it (It only redraws when you change the text though). In other words, if it is being updated constantly, and 'redrawfreq' is set to 100-300, it will only redraw it twice a second. Usually 500 is fine. The 'lines' value will automatically set the height of the textbox to fit that many lines nicely. Use 'n' to create a new line, regardless of whether or not it is at the edge of the box (example: "line 1nline 2").

Example


Input Box
Notes: No graphic necessary.

Example:


If you have trouble getting something to work, let me know. I will work to make sure you get it working.

Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 3rd Jan 2008 00:16 Edited at: 3rd Jan 2008 00:17
I decided to make a small demo showcasing some of the features.

The code for the demo:


The screenshot:
Click to View Image

The download link (Project file, source files, media, EXE):
Click to Download

common people are walking in line.
Blood Of The Prophets
17
Years of Service
User Offline
Joined: 6th Nov 2007
Location:
Posted: 5th Jan 2008 22:01
I'm surprised you haven't had any replies for this thread, because I've been watching it for a few days now. Anyway the code is rock solid and the demo you posted works really well.

It looks like I'm going to be using your code as well, for my new Steam-like GUI system. So thanks for the leg up.
Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 7th Jan 2008 04:26
No problem, I'm glad I was able to help someone out.

common people are walking in line.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 1st Mar 2008 19:15
It looks good... I will see if that can be used in GDK(.NET)

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine (thanks kBessa)
Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 2nd Mar 2008 07:00
Cool, let me know if you have any luck with it.

matty47
17
Years of Service
User Offline
Joined: 20th Nov 2007
Location:
Posted: 3rd Mar 2008 20:44
Can you point me to where I can find the two plugins required. I did a forum search for both array and IanM and could not see anything. Thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Mar 2008 21:29
See my sig

The latest release of the utility plug-ins has the array plug-in rolled into it, so you don't need to visit my site at all.

Login to post a reply

Server time is: 2024-11-22 12:50:15
Your offset time is: 2024-11-22 12:50:15