The button class draws a clickable rectangle on the screen to be used as a callback interface.
More...
|
| Button (void) |
| Default constructor. More...
|
|
| Button (int w, int h, int x, int y) |
| Overload Constructor. More...
|
|
| Button (int w, int h, int x, int y, string texture) |
| Overload constructor that receives dimensions and texture file. More...
|
|
int | getType (void) |
| Returns the element type. More...
|
|
void | onClick (function< void()> f) |
| Sets the button callback with no parameters. More...
|
|
void | clicked (void) |
| Calls clicked callback. More...
|
|
void | onHover (function< void()> f) |
| Sets the button hover callback with no parameters. More...
|
|
void | hovering (void) |
| Calls hovering callback. More...
|
|
void | setColor (const Eigen::Vector4f &c) |
| Sets the button color. More...
|
|
| Element (void) |
| Default constructor. More...
|
|
Eigen::Vector2i | getDimensions (void) |
| Returns the element's dimensions. More...
|
|
Eigen::Vector2i | getPosition (void) |
| Returns coordinates of elements top left corner. More...
|
|
void | setDimensions (const Eigen::Vector2i &dim) |
| Sets the button dimensions. More...
|
|
void | setDimensions (int w, int h) |
| Sets the button dimensions. More...
|
|
virtual void | setDimensionsFromHeight (int h) |
| Sets the width proportinal to given height Uses texture dimensions as parameter, it must be already set. More...
|
|
virtual void | setTexture (string file) |
| Loads the button texture file. More...
|
|
virtual void | setAltTexture (string file) |
| Loads the button texture file. More...
|
|
virtual void | setModelMatrix (void) |
| Sets the element model matrix. More...
|
|
void | setPosition (const Eigen::Vector2i &pos) |
| Sets the button top left position. More...
|
|
void | setPosition (int x, int y) |
| Sets the button top left position. More...
|
|
bool | isInside (int x, int y) |
| Overloads the isInside method. Queries if a point is inside the button. More...
|
|
virtual bool | isInside (const Eigen::Vector2i &pos) |
| Returns if a point is inside the element controller. More...
|
|
virtual void | release (void) |
| Set behavior when mouse is released after clicking this element. More...
|
|
virtual void | cursorMove (int x, int y) |
| Set behavior when mouse is released after clicking this element. More...
|
|
virtual void | render (Camera &camera_2d, Shader &shader) |
|
virtual void | setCallback (function< void()> f) |
|
virtual void | setCallback1i (function< void(int) > f) |
| Sets the callback from an method. More...
|
|
virtual void | setCallback1f (function< void(float) > f) |
| Sets the callback from an method. More...
|
|
virtual void | callback (void) |
| Callback with no parameters. More...
|
|
virtual void | callback (int p) |
| Callback with 1 integer. More...
|
|
virtual void | callback (float p) |
| Callback with 1 integer. More...
|
|
void | show (void) |
| Shows element. More...
|
|
void | hide (void) |
| Hides element. More...
|
|
void | toggleDisplay (void) |
| Toggles show/hide flag. More...
|
|
bool | isVisible (void) |
| Return whether element is visible or not. More...
|
|
The button class draws a clickable rectangle on the screen to be used as a callback interface.