Code: Gui module or include file
Hi folks,
one thing we will need, no matter which game we will decide on, is a GUI module or include file which provide the following functionality:
1) Setup a grafical interface (via OpenGL/TBGL), based on images and dynamically build elements
2) Save and load functionality from/into XML files
3) an editor to create the gui on screen
4) React on mouse, keyboard and controller input
5) Work independantly from the rest of a game
GUI elements should be at least ...
- Window
- Button
- Checkbox
- Radiobutton
- Label
- Textbox (mayber scrollable)
- Frame
It would be nice if this gui would be skinable but if it would totally dynamic then I would say it would be great too.
If someone would like to work on this or allready have something like this in the pipeline, then please let us know.
Michael
1 Attachment(s)
Re: Code: Gui module or include file
Hi Mike,
I know you might not like my idea :), but what about using skinned UI window to do the job for load / save / options screens? I attach very basic example. This way we will get all the comfort UI provides, and still can influence the look of dialogs a bit.
In the example just press ESC to access menu.
Petr
Re: Code: Gui module or include file
Petr,
adding the following code will be also possible to move dialog:
In global space:
[code=thinbasic] DECLARE FUNCTION ReleaseCapture LIB "USER32.DLL" ALIAS "ReleaseCapture" () AS LONG
[/code]
In dialog calback
[code=thinbasic]
CASE %WM_LBUTTONDOWN
CALL ReleaseCapture
dialog send cbhndl, %WM_NCLBUTTONDOWN, %HTCAPTION, %NULL
case %WM_MOVE
TBGL_ClearFrame
TBGL_SceneRender(%sScene)
TBGL_DrawFrame
[/code]
Eros
Re: Code: Gui module or include file
Hi Eros,
when the dialog would be moving, it would call render function.
But in most games the dialog is just centered in window and you cannot move it.
Petr
Re: Code: Gui module or include file
Quote:
Originally Posted by Psch
when the dialog would be moving, it would call render function.
oh, thanks.
Amended above code works fine.
Your idea seems an elegant and easy to use solution that can bring all the functionalities of UI module to manage game options.
Re: Code: Gui module or include file
I ment a solution for using inside a game screen. But thanks anyway, I'll check your code later.
Re: Code: Gui module or include file
Mike,
I know you meant rendered GUI, but I choose now to work on particles.
Once I have them done, I can check out this, but not sooner, to not split "powers" too much.
Petr
Re: Code: Gui module or include file
Petr, I didn't expect you to work on all of these things. :) You should leave something to the others too, you know ;)
Re: Code: Gui module or include file
Ok, I had a look with your sample. I'm my oppinion it works only if you want to have a dialog with regular windows controls. And then you still have regular looking controls, just the background is skinned.
Re: Code: Gui module or include file
Yes Mike,
that is true ... when I think of it this fact could make a strange contrast for the game, we will see.
Petr