Using Guichan

Previous topic - Next topic

MrTAToad

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 :
Code (glbasic) Select
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]

bigsofty

Excellent stuff Mr. T! Have you tried this with the iPhone yet?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

MrTAToad

No, not yet - want to update all my games first.

Don't expect any trouble though...

MrTAToad

Its very sluggish with Sun Virtual Machine and Linux - seems pretty much okay with XP though.

Here is a more recent set of files, by the way.

[attachment deleted by admin]

bigsofty

Is the source to the original demo, the one with all the controls used on it, available?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

MrTAToad

Its here!

I dont know the current state of it - it should compile okay though.

[attachment deleted by admin]

bigsofty

Many thanks!  :good:
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

bigsofty

Seems to be a little bit out of date, 'erase' function missing from the interface and some commands looking for different params?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

MrTAToad

#8
Its the latest version, by the sound of it.  You'll probably need to uncomment most of the code because at the time I was testing tabs.

It does compile file though.