Page 1 of 2

How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 1:44 am
by spum
alright so i want to post this topic so i can learn how to make Graphical User Interface's, because my game,editor, and engine aren't very user friendly and for my dev team to use them to thier fullest they need all of the functions avalible to them, so if you know anything about how to create toolbars, tabs, and palletes, then plz post a simple tut or a command library for blitzbasic or c++, thx!!!

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 1:58 am
by Moosader
BlitzBasic OR C++? That's a bit of a leap.

GUIs can be pretty damn hard to make. There are things like wxWidgets, which will handle that sort of stuff for you if you're wanting to look into the cheap-and-easy way.

Otherwise, AFAIK anyways, you'll have different objects...

* Widget - most basic object type, generally stores x, y, w, h (or a Rect variable), maybe color.

Pretty much everything else will inherit from that base object:
* Window
* Button
* Textbox

Etc. Etc.

The thing I find difficult is linking them together. From what I gather, your buttons will have a pointer to a parent Window, and clicking the button will call a function in it's parent Window.
I haven't really figured out how to anything more complex than that.

I played with making my own for MusuGo, but I think in the next iteration (when I get around to it >_>) I'll use wxWidgets

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 2:31 am
by spum
first off just to complement on your art skill, my first look at your pic i thought is was real, so very impressive job on that, secondly i said blitz basic because the game i am working on right now is in blitz, so i thought it would be easier, so i guess to make things simple bltiz will be the language i will be using for the remainder if this topic/game/message/whatever, so how would i create an instance of a button, do graphically make the button and then program it to do something, for instance i make a button that saves a map file? is that right? anyways just for an example, take falco's adventure log, did he just use like drawimage blahblah, at blah ,at blah, and then put text into it, or does that have to do with GUI, i guess that is the real main reason for this topic is how to make do stuff like that, and i really need to make toolbars for my editor and my engine, so anyways thx lusikkamage, your awsome and i love you art.!!!

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 8:11 am
by ismetteren
LusikkaMage wrote:From what I gather, your buttons will have a pointer to a parent Window, and clicking the button will call a function in it's parent Window.
I havent done much(only one application in java) with a gui. But i am pretty sure that is a bad way to do it. In java, you would make a button, then make a class that is inheriting(actully implementing, in java there is a difference between classes and interfaces, interfaces is implemented) from a interface(cant remember the name). Then you can call a method to subsribe/listen to the button(button.addListener(this)). When the button is pressed, it will call the method from the interface, in all classes that is listening to the button.

I think you could also make a event manager class. Then call a method like evtManager.addSubsriber(this, EVT_BUTTON_PRESSED). Then the button would also have acces to the eventManager in some way, so it when it is pressed it could say: evtManager.triggerEvent(EvtButtonPressed).

The EvtButtonPressed class would contain a type(EVT_BUTTON_PRESSED), some data so you could see what button etc. that is pressed and maybe some other stuff.

I dont know if the last method is good for that kind of stuff.

Sorry for my english

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 1:29 pm
by eatcomics
For blitz, blitzbasic.com has a lot of tutorials and examples, you can go to manuals->blitzplus->blitz gui categories.
That will show you all the functions for making gui things like scrollbars windows, the file, edit, help, and so on buttons... as for c++ I have no clue :P

well I think that's all I have to say... :lol:

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 1:36 pm
by MarauderIIC
Perhaps we can get Arce to post and see what he did for the level editor gui.

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 1:38 pm
by eatcomics
Yeah the website I posted teaches you how to do that stuff.... Although marcel might know a lot more about it than I read...

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 2:32 pm
by spum
yes i would love for marcel to put his info, i'll send him a message!!! and i will check out that site

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 6:28 pm
by MarauderIIC
Also, spum, I'd like to kindly remind you of rule 3 from this forum's "read before posting"
3) [...] If it doesn't make sense, retype it, reword it, or do whatever you did to (hopefully) pass 3rd grade english. We aren't going to spend excessive amounts of time debugging your english along with your code.
A few more periods and a bit more capitalization, please. Your first and second posts in this thread especially are too hard to read.

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 9:11 pm
by Arce
Haha, dunno how I missed this topic...Especially when you guys have mentioned me by name in here a few times? XD

Anyway, I'd begun writing a small tutorial, but I really don't have time to finish...I could post what I have, but I didn't get very far into the coding, yet...So I'll just hold off till I'm done (tomorrow or the day after). Don't worry, I've got plenty to say and can hopefully point ya in the right direction. Until then, good luck and don't give up.

Re: How to create GUI's with blitz basic or any language,

Posted: Tue Jan 06, 2009 9:15 pm
by eatcomics
rofl :lol: I noticed he was online and pmed him to make sure he posted to this topic.

Re: How to create GUI's with blitz basic or any language,

Posted: Wed Jan 07, 2009 2:35 pm
by spum
Well, I do apologize for not reading the rules. From now on when I post i will make sure that I am grammatically correct. I was rushing by the way. I am very literate when it comes to the English language, and I would certainly not want to be called dumb. Thanks for the Heads Up Marauder. :)

Re: How to create GUI's with blitz basic or any language,

Posted: Wed Jan 07, 2009 3:22 pm
by MarauderIIC
Hooray! We have improved the forum reading experience! :)

Re: How to create GUI's with blitz basic or any language,

Posted: Wed Jan 07, 2009 3:42 pm
by spum
haha..........

Re: How to create GUI's with blitz basic or any language,

Posted: Wed Jan 07, 2009 6:19 pm
by dandymcgee
spum wrote:haha..........
*Gasp* He didn't capitalize but he sure did punctuate.