GUI Manager

M3D-Engine renders its GUI in 1 draw call, using off-screen compositing for windows and text. Other notable features are
  • 3D Projected GUI : Create in-game GUIs for the player to interact with
  • Automatic Scaling Mode : easily accommodate with various screen resolutions and factors
  • Semi-Transparent GUI : select between uniform alpha value for the entire GUI, or window alpha stacking
  • Zero Overhead Operations : moving/scaling windows is virtually free
1- Architecture Overview
The GUI Manager role is to present the player with graphic informations, and react to the player’s responses. This task is achieved using user-defined graphic panels, called windows. They are rectangular screen regions where images are drawn and graphical events are sent and handled. A game client defines a window as a hierarchy of smaller graphic components, called widgets. These widgets serve as en encapsulation of specific graphic object behaviours, such as buttons, text fields, or images. This widget hierarchy, or widget tree, holds the definition and states for a window, and can therefore be viewed as its ‘data model’. When a window becomes visible, a ‘view’ is created, and remains active until that window becomes invisible again. gui_widgetTree This view resides in Video Memory, and consists in:
  • 6 vertices in a buffer object
  • a rectangular region in an off-screen texture, the Compositing Buffer.
In order to create the view, the compositing engine uses a client-defined texture as image source. The data model stores informations on what part of the image source to use to paint the different widgets. To speed-up text compositing, a separate cache, the Glyph Buffer, is maintained to store the constructed text strings, and is sampled during composition of labels and text fields. gui_compositing When a frame is drawn, this buffer is used as a texture source and the GUI Manager draws the Vertex Buffer Object containing the visible windows. gui_renderer When the data model changes during the lifetime of a view, the Compositing Buffer is updated to reflect the change. Moving a window on-screen simply boils down to updating the values of the 6 vertices representing the window’s rectangle. Semi-transparent windows.
2- Widget Types
Standard GUI components are described by adding one or more extensions to a widget base. These extensions are:
Drawable the widget has a graphical representation
Text the widget is able to render text
EventResponder the widget can respond to events and inputs
Container the widget can contain other widgets
below is a list of accessible widgets, and the extensions they use:
Name Description Drawable_EXT Text_EXT EventResponder_EXT Container_EXT
Image defines a region in the active GUI texture Y
Label a block of text Y
ActiveRegion Y
Button the combination of the 3 precedent extensions Y Y Y
Window a basic widget group Optional Y Y
ScrollView a virtual widget space Y Y

Comments are closed