Neo
0.5.0
Developer Documentation
|
The Neo2DEngine class contains all functionality to set up a GUI. More...
#include <Neo2DEngine.h>
Public Member Functions | |
Neo2DEngine () | |
~Neo2DEngine () | |
FontRef * | loadFont (const char *filename, unsigned int fontsize) |
TextureRef * | loadTexture (const char *filename, const bool mipmap=true, const bool preload=true) |
const char * | getThemeDirectory () |
const char * | getThemeBorderH () |
const char * | getThemeBorderV () |
const char * | getThemeBody () |
const char * | getThemeEdge () |
const char * | getThemeBorderHHover () |
const char * | getThemeBorderVHover () |
const char * | getThemeBodyHover () |
const char * | getThemeEdgeHover () |
const char * | getThemeBorderHPressed () |
const char * | getThemeBorderVPressed () |
const char * | getThemeBodyPressed () |
const char * | getThemeEdgePressed () |
void | setThemeDirectory (const char *dir) |
Changes the current GUI theme. This change only applies to newly created widgets, all existing ones will keep using the previously selected theme. More... | |
void | setupLuaInterface (ScriptContext *script) |
Registers all script functions to the given context. More... | |
void | setEnabled (bool enabled) |
Enables or disables the GUI. More... | |
void | draw () |
Draws all Canvases in the order the are layered in. More... | |
void | update () |
Updates all Canvases. More... | |
const char * | getDefaultFont () |
Returns the default font. More... | |
float | getDefaultFontSize () |
Returns the default font size. More... | |
void | setDefaultFontSize (float s) |
Changes the default font size. More... | |
Vector4 | getNormalBackground () |
Returns the normal background color. More... | |
Vector4 | getHoverBackground () |
Returns the hover background color. More... | |
Vector4 | getHighlightBackground () |
Returns the highlight color. More... | |
void | setNormalBackground (Vector4 color) |
Changes the normal background color. More... | |
void | setHoverBackground (Vector4 color) |
Changes the hover background color. More... | |
void | setHighlightBackground (Vector4 color) |
Changes the highlight background color. More... | |
Widget * | getWidget (unsigned int idx) |
Retrieves a registered widget using its handle. More... | |
DISOWN (Widget *w) int addWidget(Widget *w) | |
Adds a widget to the internal list. More... | |
size_t | getNumWidgets () |
Returns the number of registered widgets. More... | |
DISOWN (Canvas *c) void addCanvas(Canvas *c) | |
Adds a new Canvas to the update list. More... | |
Canvas * | getCanvas (unsigned int i) |
Returns the Canvas with the given index. More... | |
void | updateLayers () |
Sorts all Canvases to match the priority hierarchy defined by the layer mechanism. More... | |
void | destroyWidget (int id) |
Destroys the widget with the given handle. More... | |
void | clear () |
Deletes all widgets and canvases except the main canvas. More... | |
void | scheduleClear () |
bool | isMouseOnGui () |
Static Public Member Functions | |
static Neo2DEngine * | getInstance () |
Returns a global instance of the GuiSystem. More... | |
The Neo2DEngine class contains all functionality to set up a GUI.
Neo2D::Neo2DEngine::Neo2DEngine | ( | ) |
Neo2D::Neo2DEngine::~Neo2DEngine | ( | ) |
void Neo2D::Neo2DEngine::clear | ( | ) |
Deletes all widgets and canvases except the main canvas.
void Neo2D::Neo2DEngine::destroyWidget | ( | int | id | ) |
Destroys the widget with the given handle.
id | The handle. |
Neo2D::Neo2DEngine::DISOWN | ( | Widget * | w | ) |
Adds a widget to the internal list.
The | new widget. |
Neo2D::Neo2DEngine::DISOWN | ( | Canvas * | c | ) |
void Neo2D::Neo2DEngine::draw | ( | ) |
Draws all Canvases in the order the are layered in.
|
inline |
|
inline |
Returns the default font.
|
inline |
Returns the default font size.
|
inline |
Returns the highlight color.
|
inline |
Returns the hover background color.
|
static |
Returns a global instance of the GuiSystem.
|
inline |
Returns the normal background color.
|
inline |
Returns the number of registered widgets.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Widget* Neo2D::Neo2DEngine::getWidget | ( | unsigned int | idx | ) |
Retrieves a registered widget using its handle.
idx | The handle of the widget. |
bool Neo2D::Neo2DEngine::isMouseOnGui | ( | ) |
FontRef* Neo2D::Neo2DEngine::loadFont | ( | const char * | filename, |
unsigned int | fontsize | ||
) |
TextureRef* Neo2D::Neo2DEngine::loadTexture | ( | const char * | filename, |
const bool | mipmap = true , |
||
const bool | preload = true |
||
) |
|
inline |
|
inline |
Changes the default font size.
s | The default font size. |
|
inline |
Enables or disables the GUI.
A | boolean. |
|
inline |
Changes the highlight background color.
color | The highlight background. |
|
inline |
Changes the hover background color.
color | The hover background. |
|
inline |
Changes the normal background color.
color | The normal background. |
void Neo2D::Neo2DEngine::setThemeDirectory | ( | const char * | dir | ) |
Changes the current GUI theme. This change only applies to newly created widgets, all existing ones will keep using the previously selected theme.
Following fils are required: "/body.png", "/edge.png", "/borderh.png", "/borderv.png", "/body-hover.png", "/edge-hover.png", "/borderh-hover.png", "/borderv-hover.png", "/body-pressed.png", "/edge-pressed.png", "/borderh-pressed.png", "/borderv-pressed.png"
dir | The directory containing the theme files. |
void Neo2D::Neo2DEngine::setupLuaInterface | ( | ScriptContext * | script | ) |
Registers all script functions to the given context.
script | The script interface to register to. |
void Neo2D::Neo2DEngine::update | ( | ) |
Updates all Canvases.
void Neo2D::Neo2DEngine::updateLayers | ( | ) |
Sorts all Canvases to match the priority hierarchy defined by the layer mechanism.