Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 3 (modified by bknecht, 15 years ago) (diff)

Graphical User Interface

TracNav(TracNav/TOC_Development)?

The GUI in Orxonox is administered with CEGUI. We use the GUI for interactions with the user in shops, Questsystem or parts of the HUD and of course the main menu.

CEGUI

CEGUI (Crazy Edi's GUI) is available for various graphic engines like Ogre or Irrlicht. In Orxonox we use the OgreCEGUIRenderer to display our GUI.

GUI Framework

The framework consists of various elements, putting all necessary elements together for a functioning GUI. Those elements are basically the GUIManager, Lua-scripts, layouts and the corresponding graphics.

GUIManager

Written in C++ the GUIManager manages all the GUIs in Orxonox and represents the interface to CEGUI. Connected to Lua via a tolua++ interface it is able to load Lua-scripts and connect C++-functions to Lua and vice versa.

Lua-scripts

Lua-scripts are written in Lua and implement the functionalities of CEGUI like interactivity. Each GUI needs a separate Lua-script which will be loaded by the main script.

Usually you would set some variables and define some events inside the Lua-script. You may want for instance to define what layout you want to load. Check out the existing scripts to get an idea of the intended use.

Imagesets

Images are loaded in so called imagesets. As the name suggests, you can group several images into one single imageset. This can be used for instance when defining "active", "hover", "clicked" and "inactive" state of a button. You'd load just one image file into the imageset, but define various images from that imageset.

Imageset files are written in XML and very easy to use. To be able to use the specified images though, you need to include the imageset into a scheme file.

Schemes

Schemes define a certain style and provide the Lua-script with the necessary resources. It is written in XML. At the moment we just use the standard-scheme for the window look and for our own images (OrxonoxGUIScheme.scheme). Since this is included in the main script, you just have to add your new imageset to the scheme and can forget about it.

Layouts

Layouts define the structure of the GUI. It defines the positions of the various elements and their size and behavior. You can also add events to the elements of the GUI and process the event in the Lua-script. Everything is written in XML, but you can access every parameter of each element in the layout. The layout however reaches its limits soon, but it is advised to define as much as possible in the layout.

GUI-Elements

Every GUI-element is a window. The underlying class-structure inherits everything from a basic window element. Buttons and text input elements implement various new parameters and functions. They also need different kinds of images. At the moment we advise to use a predefined look for our GUI, namely the TaharezLook. However this may change in the future, when we want to define our own looks. Check out the parameters and functions of each element in the layouts already in the media directory or in the CEGUI-API. The API is written for C++, but you can access the same function in a similar fashion, using Lua or XML.

Windows

Cursor