#include <Theme.h>
Classes | |
class | ImageList |
struct | SideRegions |
class | Skin |
class | Style |
class | ThemeImage |
struct | UVs |
Public Types | |
typedef SideRegions | Margin |
typedef SideRegions | Border |
typedef SideRegions | Padding |
Public Member Functions | |
Theme::Style * | getStyle (const char *id) const |
Theme::Style * | getEmptyStyle () |
SpriteBatch * | getSpriteBatch () const |
Static Public Member Functions | |
static Theme * | create (const char *url) |
static Theme * | getDefault () |
Defines a theme used to represent the look or appearance of controls.
Once loaded, the appearance properties can be retrieved from their style IDs and set on other UI controls. A Theme has one property, 'texture', which points to a texture atlas containing all the images used by the theme. Cursor images, skins, and lists of images used by controls are defined in their own namespaces. The rest of the Theme consists of Style namespaces. A Style describes the border, margin, and padding of a Control, what images, skins, and cursors are associated with a Control, and Font properties to apply to a Control's text.
typedef SideRegions gameplay::Theme::Border |
Struct representing border areas by the width or height of each side.
typedef SideRegions gameplay::Theme::Margin |
Struct representing margin areas by the width or height of each side.
typedef SideRegions gameplay::Theme::Padding |
Struct representing padding areas by the width or height of each side.
static Theme* gameplay::Theme::create | ( | const char * | url | ) | [static] |
Creates a theme using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
url | The URL pointing to the Properties object defining the theme. |
static Theme* gameplay::Theme::getDefault | ( | ) | [static] |
Returns the default theme.
Get the empty style. Used when a control does not specify a style. This is especially useful for containers that are being used only for layout and positioning, and have no background or border themselves. The empty style has no border, background, margin, padding, images, etc.. Any needed properties can be set on the control directly.
SpriteBatch* gameplay::Theme::getSpriteBatch | ( | ) | const |
Returns the sprite batch for this theme.
Theme::Style* gameplay::Theme::getStyle | ( | const char * | id | ) | const |
Get a style by its ID.
id | The style ID. |