My modified version of Guichan seems to be very usable, so here are a few instructions on how to use it.
- First, you are going to need all the C++ code (which just so happens to be included in this very post). The files need to go into the same place as your project file (which, if you have multiple projects for the different platforms that GLBasic supports, may not be the same place as the source code)
- Next, you need the include GLBasic code added to your main project file.
- Then, you need to initialise Guichan with by calling GUI_Initialise
- Before the SHOWSCREEN command, you need to call the GUI_Update() command to update all mouse positions and perform all logic
- At some point, you will destroy all your created windows, containers, labels etc with GUI_Delete, and shutdown Guichan with GUI_Shutdown)
- It does take some time to compile - especially over a network
Some notes :
- Widgets outside a window will still be displayed - may or may not be a bug...
- At the moment, there is nothing to allow changing of colours, alpha values, preventing a window from being moved. Most of that will be added later
- Tabs aren't terribly complicated to use - I'm using them like this :
window%=GUI_CreateWindow(2,options.screenHeight%-200,"Options",options.screenWidth%-4,180,FALSE)
genContainer%=GUI_CreateContainer()
nameContainer%=GUI_CreateContainer()
tabArea%=GUI_CreateTabbedArea(options.screenWidth%-4,200)
GUI_CreateLabel(genContainer%,1,1,"Music Volume :",PTR_CONTAINER%)
GUI_CreateLabel(genContainer%,1,23,"SFX Volume :",PTR_CONTAINER%)
GUI_CreateLabel(genContainer%,1,45,"Screen Resolution :",PTR_CONTAINER%)
GUI_CreateLabel(genContainer%,1,67,"Use Full Screen ?",PTR_CONTAINER%)
GUI_CreateLabel(genContainer%,1,89,"Use Background :",PTR_CONTAINER%)
GUI_AddTabItem(tabArea%,"General",genContainer%,IS_CONTAINER%)
GUI_CreateLabel(nameContainer%,1,1,"Player 1 Name :",PTR_CONTAINER%)
GUI_CreateLabel(nameContainer%,1,23,"Player 2 Name :",PTR_CONTAINER%)
GUI_CreateLabel(nameContainer%,1,45,"Player 3 Name :",PTR_CONTAINER%)
GUI_CreateLabel(nameContainer%,1,67,"Player 4 Name :",PTR_CONTAINER%)
GUI_AddTabItem(tabArea%,"Name",nameContainer%,IS_CONTAINER%)
GUI_AddTab(window%,tabArea%,0,0,IS_WINDOW%)
I'll be updating all my three games to use it. At some point I'll be having to do a keyboard overlay for those platforms that dont have a keyboard.
If anyone does find a problem with the source code, let me know. Performance wise, it should be fine for even complicated things - however, it doesn't work well in a virtual machine.
[attachment deleted by admin]