Jump to content
  • Advertisement
Sign in to follow this  
coldacid

Any CEGUI users?

This topic is 4875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Considering that OGRE is pretty much pulling out any of the interactive panel components by 1.0, I'm looking at CEGUI as a way to implement a user interface for projects. Unfortunately, neither the Taharez or Windows looks are what I want, and additionally, there doesn't seem to be any tutorials on using OGRE and CEGUI. (The demo source code demonstrates how, but I want something in plain English as well. In addition, the demos don't show how to do one's own look DLLs.) So, how many people have actually used CEGUI?

Share this post


Link to post
Share on other sites
Advertisement
Depending upon exactly what you need to achieve, many times you can get away with simply editing the "Imageset" - that is the image file and the xml file that defines the named image components that are used by the 'look' module.

The majoriy of the components in the two provided look modules are written in such a way that they can auto-adjust to changes in the size of the component images. This being said, you will be limited by the layout 'approach' taken by the look module; for example, Taharez uses three horizontal sections for a push button, whereas Windows-Look uses a full nine images. For maximum customisation without needing to write new code, Windows-Look is generally more flexible.

To write a new look module from scratch is daunting, especially if you do not know the library well. It is advised that you use one of the current modules as a jumping off point, and just change what you need to. The system is largely structured so that the functionality is in the base system; the look modules generally have two jobs, first to draw whatever needs to be drawn for a specific widget, and second to layout any child windows used by the widget.

Drawing of imagery is abstracted away to offer a simple 2D image drawing system. For the most simplest of UI elements you could use one image per widget and simply stretch the image over the area used by the widget being drawn.

Another thing to consider is that you do not need to implement the full set of widgets when you write a new look module. You are free to just implement the ones that you are unable to use from the current modules. This gives you the possibility to use modified imagery where possible, and only code new rendering classes for the widgets which you require to do something a bit more special.

You are able to specify which widgets from which modules you want to register with the system via the XML scheme files; this also (generally) enables you to 'replace' widgets in the current modules and have them used instead (any issues with the workings of this will be fixed as and when they are reported).

Tutorials and examples are definitely lacking; this is something I would like to correct, though due to time constraints is always the thing that gets pushed back.

Using the system is pretty straightforward:

* Create the GUI renderer object
* Instantiate the CEGUI::System object (passing in the renderer created above
* As part of your render loop, call CEGUI::System::renderGUI() method.
* Feed mouse and key inputs into the system via the CEGUI::System::inject* family of methods.

For Ogre users the need to call the render method is handled automagically by the GUI renderer, so you do not have to worry about this step.

The system will draw whatever is set at the current GUI 'sheet' (or root window) in the System object, depending upon your needs you can use a DefaultGUISheet (which is basically a blank canvas onto which you can attach other windows and/or widgets), or you can set any window derived class here instead; which is useful if you just want a single pop-up style window.

This is obviously a very brief overview, a full description of all the ins and outs would fill a book (which is on the todo list also), though I hope that you'll persevere with the system; I believe that, like many users, once you get a few things working, the learning curve begins to even out a little.

CE.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!