mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
An OpenGL button in a 2d environment. More...
#include <Button.h>
Public Member Functions | |
Button (int innerBorder, int outerBorder, MouseHandler *mouse, std::string text, TextureFont *tf, unsigned int minLength, unsigned int centerx=0, unsigned int centery=0, int windowWidth=1, int windowHeight=1) | |
Creates a new button. | |
void | draw () |
bool | isMouseOverObject () |
void | mouseClick () |
void | setCenter (unsigned int centerx, unsigned int centery) |
void | setWindowDimensions (int wwidth, int wheight) |
size_t | getButtonWidth () |
size_t | getButtonHeight () |
unsigned int | getButtonInnerWidth () |
unsigned int | getButtonInnerHeight () |
bool | isClicked () |
void | noClick () |
void | activateButton () |
void | deactivateButton () |
void | switchOn () |
void | switchOff () |
bool | isActive () |
bool | isOn () |
~Button (void) | |
Button::Button | ( | int | innerBorder, |
int | outerBorder, | ||
MouseHandler * | mouse, | ||
std::string | text, | ||
TextureFont * | tf, | ||
unsigned int | minLength, | ||
unsigned int | centerx = 0 , |
||
unsigned int | centery = 0 , |
||
int | windowWidth = 1 , |
||
int | windowHeight = 1 |
||
) |
Creates a new button.
innerBorder | the inner border around the text |
outerBorder | the outer border around the text |
mouse | the MouseHandler that receives mouse input |
text | the text displayed on the button |
tf | the TextureFont used for the text |
minLength | the minimal width of the button (even if the text is shorter than the minimum length |
centerx | the x-coordinate of the center of the button |
centery | the y-coordinate of the center of the button |
windowWidth | the width of the containing window |
windowHeight | the height of the containing window |
Definition at line 31 of file Button.cpp.
Button::~Button | ( | void | ) |
Definition at line 64 of file Button.cpp.
void Button::activateButton | ( | ) |
Definition at line 173 of file Button.cpp.
void Button::deactivateButton | ( | ) |
Definition at line 178 of file Button.cpp.
void Button::draw | ( | void | ) |
Definition at line 117 of file Button.cpp.
size_t Button::getButtonHeight | ( | ) |
Definition at line 102 of file Button.cpp.
unsigned int Button::getButtonInnerHeight | ( | ) |
Definition at line 112 of file Button.cpp.
unsigned int Button::getButtonInnerWidth | ( | ) |
Definition at line 107 of file Button.cpp.
size_t Button::getButtonWidth | ( | ) |
Definition at line 97 of file Button.cpp.
bool Button::isActive | ( | ) |
Definition at line 199 of file Button.cpp.
bool Button::isClicked | ( | ) |
Definition at line 163 of file Button.cpp.
bool Button::isMouseOverObject | ( | ) |
Definition at line 80 of file Button.cpp.
bool Button::isOn | ( | ) |
Definition at line 194 of file Button.cpp.
void Button::mouseClick | ( | ) |
Definition at line 90 of file Button.cpp.
void Button::noClick | ( | ) |
Definition at line 168 of file Button.cpp.
void Button::setCenter | ( | unsigned int | centerx, |
unsigned int | centery | ||
) |
Definition at line 68 of file Button.cpp.
void Button::setWindowDimensions | ( | int | wwidth, |
int | wheight | ||
) |
Definition at line 74 of file Button.cpp.
void Button::switchOff | ( | ) |
Definition at line 189 of file Button.cpp.
void Button::switchOn | ( | ) |
Definition at line 184 of file Button.cpp.