Current version is 1.21
Entropy User Interface is my name for a group of functions I have made which deal with creating and controlling a customizable interface. To allow it to update quickly I shifted it to rely on
Cloggy's d3d_func v3 dll in one of the previous versions. The previous versions were in the code snippets under the name “Decent Gui”, but I have decided that a 3000 line chunk of code is too long for that board and this is no longer just “Decent”.
This code is about as free and open as possible. As long as you are not explicitly taking credit for creating these functions I am fine with it.
This only works for Dark Basic Pro. Sorry for everyone else. As for DBPro users, this should be as easy as including the file.
Working:
Windows
Buttons
Scrollbars
Statusbars
Listboxes
Checkboxes
Option buttons
Inputboxes
Comboboxes
[new!]
Planned:
Menu System
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 separate 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.
Do you have any ideas for other gadgets for me to create or should I just move right into the dreaded menu system?
Screenshots:
I'm in need of in-game screen shots, so these will have to do for now.
Easily runs with 3d in the background.
This is what everything looks like. (By default)
You can have as many different styles in one program as you want. (Assuming you do not exceed the limit of the integer)
Still working on this game:
Here is the download.
Here
Here is an example.
sync on
sync rate 0
d3d_init
d3d_font 1,"Gungsuh",12,0,0,1
d3d_font 2,"Times New Roman",14,0,1,1
gui_setup()
class_window_create("Emo",rgb(0,0,0),rgb(255,0,0),rgb(20,20,20),rgb(80,0,0),250,2,rgb(255,255,255))
class_button_create("Emo",rgb(0,0,0),rgb(255,255,255),2,rgb(255,0,0))
class_statusbar_create("Emo",rgb(255,255,255),rgb(255,0,0))
class_scrollbar_create("Emo",rgb(0,0,0),rgb(255,0,0))
class_option_create("Emo",rgb(255,0,0),rgb(0,0,0))
class_checkbox_create("Emo",rgb(255,0,0),rgb(0,0,0))
class_inputbox_create("Emo",rgb(0,0,0),2,rgb(255,0,0))
class_listbox_create("Emo",rgb(0,0,0),rgb(255,255,255),2,rgb(255,0,0))
class_combobox_create("Emo",rgb(10,10,10),rgb(255,255,255),2,rgb(255,0,0))
window_create("Format Example")
window_size("Format Example",400,300)
window_text("Format Example",0,0,"This example demonstrates how to format each object.")
button_create("Button")
button_attach("Button","Format Example",10,30)
statusbar_create("Statusbar")
statusbar_rotate("Statusbar",90)
statusbar_attach("Statusbar","Format Example",200,30)
scrollbar_create("Scrollbar")
scrollbar_attach("Scrollbar","Format Example",300,30)
option_create("First Option")
option_create("Second Option")
option_create("Third Option")
option_attach("First Option","Format Example",10,60)
option_attach("Second Option","Format Example",30,60)
option_attach("Third Option","Format Example",50,60)
option_size("First Option",15,15)
option_size("Second Option",15,15)
option_size("Third Option",15,15)
checkbox_create("Checkbox 1")
checkbox_create("Checkbox 2")
checkbox_create("Checkbox 3")
checkbox_size("Checkbox 1",15,15)
checkbox_size("Checkbox 2",15,15)
checkbox_size("Checkbox 3",15,15)
checkbox_attach("Checkbox 1","Format Example",100,60)
checkbox_attach("Checkbox 2","Format Example",120,60)
checkbox_attach("Checkbox 3","Format Example",140,60)
inputbox_create("Enter text: ")
inputbox_attach("Enter text: ","Format Example",10,90)
listbox_create("Listbox")
listbox_attach("Listbox","Format Example",150,90)
for i=1 to 10
listbox_additem("Listbox","Item "+str$(i))
next i
combobox_create("Combo")
combobox_attach("Combo","Format Example",280,140)
for i=1 to 10
combobox_additem("Combo","Item "+str$(i))
next i
window_create("Different Window")
window_set_class("Different Window","Emo")
window_size("Different Window",400,300)
window_text("Different Window",0,0,"This has a different format.")
window_position("Different Window",30,50)
button_create("Different Button")
button_size("Different Button",130,25)
button_set_class("Different Button","Emo")
button_attach("Different Button","Different Window",10,30)
statusbar_create("Different Statusbar")
statusbar_rotate("Different Statusbar",90)
statusbar_attach("Different Statusbar","Different Window",250,30)
statusbar_set_class("Different Statusbar","Emo")
scrollbar_create("Different Scrollbar")
scrollbar_attach("Different Scrollbar","Different Window",300,30)
scrollbar_set_class("Different Scrollbar","Emo")
option_create("Different First Option")
option_create("Different Second Option")
option_create("Different Third Option")
option_attach("Different First Option","Different Window",10,60)
option_attach("Different Second Option","Different Window",30,60)
option_attach("Different Third Option","Different Window",50,60)
option_size("Different First Option",15,15)
option_size("Different Second Option",15,15)
option_size("Different Third Option",15,15)
option_set_class("Different First Option","Emo")
option_set_class("Different Second Option","Emo")
option_set_class("Different Third Option","Emo")
option_group("Different First Option",1)
option_group("Different Second Option",1)
option_group("Different Third Option",1)
checkbox_create("Different Checkbox 1")
checkbox_create("Different Checkbox 2")
checkbox_create("Different Checkbox 3")
checkbox_size("Different Checkbox 1",15,15)
checkbox_size("Different Checkbox 2",15,15)
checkbox_size("Different Checkbox 3",15,15)
checkbox_attach("Different Checkbox 1","Different Window",100,60)
checkbox_attach("Different Checkbox 2","Different Window",120,60)
checkbox_attach("Different Checkbox 3","Different Window",140,60)
checkbox_set_class("Different Checkbox 1","Emo")
checkbox_set_class("Different Checkbox 2","Emo")
checkbox_set_class("Different Checkbox 3","Emo")
inputbox_create("Different Enter text: ")
inputbox_attach("Different Enter text: ","Different Window",10,90)
inputbox_set_class("Different Enter text: ","Emo")
listbox_create("Different Listbox")
listbox_attach("Different Listbox","Different Window",150,90)
listbox_set_class("Different Listbox","Emo")
scrollbar_set_class("Different Listboxscroll","Emo")
for i=1 to 10
listbox_additem("Different Listbox","Item "+str$(i))
next i
combobox_create("D Combo")
combobox_attach("D Combo","Different Window",280,140)
for i=1 to 10
combobox_additem("D Combo","Item "+str$(i))
next i
combobox_set_class("D Combo","Emo")
do
sync
cls rgb(0,0,150)
d3d_starttext
d3d_text 1,0,0,0,"Frame Rate: "+str$(screen fps())
d3d_endtext
gui_update()
loop
Also take note of the “user” type. Events like mouseup are stored to this allowing you to easily control events in this user interface.
[If a mod wants to delete Decent Gui from the code snippets they can since this is where I plan to post updates.]