#include <sgPanel.h>
Public Member Functions | |
sgPanel (sgPanel *p, sgPanel *n) | |
~sgPanel () | |
sgPanel * | createPanel () |
void | addImage (const char *imgtexfile, const sgVector2 &pos, const sgVector2 &size, const char *vs=NULL, const char *fs=NULL) |
void | addText (const char *str, const sgVector2 &charsize, const sgVector2 &pos, const sgVector2 &size, const char *fonttexfile, const char *vs=NULL, const char *fs=NULL) |
void | destroy () |
void | destroyAll () |
Public Attributes | |
sgVector2 | pos |
std::vector< sgPanelElement * > | elements |
sgPanel * | prev |
sgPanel * | next |
Panel class. This class represents a panel which can contain any number of elements.
Constructor. Initializes a panel instance.
p | pointer to the previous panel in the list or NULL | |
n | pointer to the next panel in the list or NULL |
sgPanel::~sgPanel | ( | ) |
Deconstructor. The panels deconstructor.
void sgPanel::addImage | ( | const char * | imgtexfile, | |
const sgVector2 & | pos, | |||
const sgVector2 & | size, | |||
const char * | vs = NULL , |
|||
const char * | fs = NULL | |||
) |
Add image element. Adds a new image element to the panel.
imgtexfile | file name of the image to display | |
pos | position of the images bottom left corner in pixels, relative to the panel ones | |
size | the size in pixels to display the image with | |
vs | file name of the vertex shader of the type .vsh without the type specifier or NULL to use the default shader | |
fs | file name of the fragment shader of the type .fsh without the type specifier or NULL to use the default shader |
void sgPanel::addText | ( | const char * | str, | |
const sgVector2 & | charsize, | |||
const sgVector2 & | pos, | |||
const sgVector2 & | size, | |||
const char * | fonttexfile, | |||
const char * | vs = NULL , |
|||
const char * | fs = NULL | |||
) |
Add text element. Adds a new text element to the panel.
str | the string to display | |
charsize | size in pixels of one character on the font texture | |
pos | position of the texts bottom left corner in pixels, relative to the panel ones | |
size | the size in pixels to display each character with | |
fonttexfile | file name of the font texture to use | |
vs | file name of the vertex shader of the type .vsh without the type specifier or NULL to use the default shader | |
fs | file name of the fragment shader of the type .fsh without the type specifier or NULL to use the default shader |
sgPanel * sgPanel::createPanel | ( | ) |
Create panel. Creates a new panel and puts it into the list of this one, directly behind this one.
void sgPanel::destroy | ( | ) |
Destroy. Destroys the panel and removes it from the list.
void sgPanel::destroyAll | ( | ) |
Destroy all. Destroys all panels in the list.
std::vector<sgPanelElement*> sgPanel::elements |
Elements. An array storing the pointers to all panel elements.
Next. Pointer to the next panel in the list or NULL if this is the last one.
Position. Position of the panel in pixels relative to the screens bottom left corner.
Previous. Pointer to the previous panel in the list or NULL if this is the first one.