#include <CUI_MultipleStateButton.h>
Inheritance diagram for CUI_MultipleStateButton:
Public Member Functions | |
CUI_MultipleStateButton (CUI_UI *ui=NULL, float x=0, float y=0, float x2=1, float y2=1, CUI_Frame *parent=NULL, IUI_Shader *shader=NULL, IUI_Shader *cursor=NULL, CUI_CoordSys *coordsys=NULL, char *text=NULL, IUI_Font *font=NULL, float textscale=0.8, IUI_Border *border=NULL, IUI_Shader *hover=NULL, IUI_Shader *disable=NULL, IUI_Shader *click=NULL, int numberofstates=1, int initialstate=0, actionfunc_state stateaction=NULL) | |
constructor | |
virtual | ~CUI_MultipleStateButton () |
destructor | |
virtual bool | Render (double dtime, IUI_Renderer *renderer) |
overloaded render | |
virtual unsigned int | AddState (IUI_Shader *shader=NULL, IUI_Shader *hover=NULL, IUI_Shader *disable=NULL, IUI_Shader *click=NULL) |
Add a new state to this button. | |
virtual unsigned int | GetState (void) |
get the current state | |
virtual bool | SetShader (IUI_Shader *shader, int state=0) |
set the shader for a certain state of this button | |
virtual bool | SetHoverShader (IUI_Shader *shader, int state=0) |
set the shader for a certain state to be used when this button is being hovered over | |
virtual bool | SetDisableShader (IUI_Shader *shader, int state=0) |
set the shader for a certain state to be used when this button is disabled | |
virtual bool | SetClickShader (IUI_Shader *shader, int state=0) |
set the shader for a certain state to be used when this button is clicked | |
virtual bool | Click (int &id, int &numparam, void **param) |
Call the click action function. | |
virtual void | DeleteParam (void *param) |
Delete a parameter allocated by this frame. | |
virtual bool | Reset () |
reset to state 0 | |
virtual bool | SetState (unsigned short state) |
jump to a state | |
virtual unsigned short | GetNumStates () |
get the number of states this button has | |
Protected Attributes | |
unsigned short | m_numstates |
Number of states this button has. | |
unsigned int | m_currentstate |
current state this button is in | |
IUI_Shader ** | m_defaultShaders |
the default shaders (organized by state) | |
IUI_Shader ** | m_hoverShaders |
the hover shader (organized by state) | |
IUI_Shader ** | m_disableShaders |
the disabled shader (organized by state) | |
IUI_Shader ** | m_clickShaders |
the clicked shader (organized by state) |
Normally used for checkboxes, but also allows for more complex controls.
Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED
UI_DISABLED
UI_INACTIVE
|
destructor Free the arrays of pointers |
|
Add a new state to this button. Reallocates enough memory every single call. If anyone thinks this is a problem (it should only be happening during init), feel free to rewrite it.
|
|
Call the click action function. The UI will only call this function when the button is let up while over the same button it was clicked on Reimplemented from CUI_Button. |
|
Delete a parameter allocated by this frame. MultipleStateButtons return 1 int Reimplemented from CUI_Button. |
|
set the shader for a certain state to be used when this button is clicked
|
|
set the shader for a certain state to be used when this button is disabled
|
|
set the shader for a certain state to be used when this button is being hovered over
|
|
set the shader for a certain state of this button this is the default shader
|