Free and Open Source real time strategy game with a new take on micro-management

GUI Theming

From Globulation2

Revision as of 14:50, 2 January 2006 by Nct (talk | contribs) (Explanation about color theme)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GUI theming is made at three levels in glob2: color theming, background theming and button theming.

Color theming

All widget share some color constants. They are defined in the GAGGUI::ColorTheme namespace and initialized in the beginning of the libgag/src/GUIBase.cpp file.

Background theming

Each GUI screen inherits from the Glob2Screen class, defined in src/Glob2Screen.h and implemented in src/Glob2Screen.cpp. This class reimplement the Screen::paint virtual method so that a custom paint method is implemented.

Button theming

Button can have associated bitmaps. To do so, when you create the button, pass the name of a valid loaded sprite and two valid frame numbers, the first for idle and the second for highlighted state. If you pass no sprite name ("") and -1 to frame numbers, bitmap are disabled and default color theme is used.

Misc