mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
Button Class Reference

An OpenGL button in a 2d environment. More...

#include <Button.h>

Inheritance diagram for Button:

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)
 

Detailed Description

An OpenGL button in a 2d environment.

Definition at line 14 of file Button.h.

Constructor & Destructor Documentation

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.

Parameters
innerBorderthe inner border around the text
outerBorderthe outer border around the text
mousethe MouseHandler that receives mouse input
textthe text displayed on the button
tfthe TextureFont used for the text
minLengththe minimal width of the button (even if the text is shorter than the minimum length
centerxthe x-coordinate of the center of the button
centerythe y-coordinate of the center of the button
windowWidththe width of the containing window
windowHeightthe height of the containing window

Definition at line 31 of file Button.cpp.

Button::~Button ( void  )

Definition at line 64 of file Button.cpp.

Member Function Documentation

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.


The documentation for this class was generated from the following files: