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
MouseHandler Class Reference

Allows to check, if a mouse click in a specific position has hit an object. More...

#include <MouseHandler.h>

Public Member Functions

 MouseHandler (void)
 
 ~MouseHandler (void)
 
bool isMouseHoveringActive ()
 
void setMouseHovering (bool status)
 
bool isMouseOverRect (unsigned int left, unsigned int right, unsigned int top, unsigned int bottom)
 Detects if the mouse is over an rectangular area of the screen.
 
bool isMouseOverRectCenter (unsigned int centerx, unsigned int centery, unsigned int width, unsigned int height)
 Detects if the mouse is over an rectangular area of the screen.
 
void setMousePosition (Position position)
 
void setMousePosition (int x, int y)
 
Position getMousePosition ()
 
void setHittedObject (HitableObjects object)
 
void setHittedObjectInfo (int value)
 
HitableObjects getHittedObject (void)
 
int getHittedObjectInfo (void)
 
void setMouseMoveStartPosition (Position startPosition)
 
void setMouseMoveStartPosition (int x, int y)
 
void setMouseMoveEndPosition (Position endPosition)
 
void setMouseMoveEndPosition (int x, int y)
 
Position getMouseMoveStartPosition (void)
 
Position getMouseMoveEndPosition (void)
 

Detailed Description

Allows to check, if a mouse click in a specific position has hit an object.

Definition at line 18 of file MouseHandler.h.

Constructor & Destructor Documentation

MouseHandler::MouseHandler ( void  )

Definition at line 8 of file MouseHandler.cpp.

MouseHandler::~MouseHandler ( void  )

Definition at line 12 of file MouseHandler.cpp.

Member Function Documentation

HitableObjects MouseHandler::getHittedObject ( void  )

Definition at line 72 of file MouseHandler.cpp.

int MouseHandler::getHittedObjectInfo ( void  )

Definition at line 76 of file MouseHandler.cpp.

Position MouseHandler::getMouseMoveEndPosition ( void  )

Definition at line 104 of file MouseHandler.cpp.

Position MouseHandler::getMouseMoveStartPosition ( void  )

Definition at line 100 of file MouseHandler.cpp.

Position MouseHandler::getMousePosition ( )

Definition at line 60 of file MouseHandler.cpp.

bool MouseHandler::isMouseHoveringActive ( )

Definition at line 15 of file MouseHandler.cpp.

bool MouseHandler::isMouseOverRect ( unsigned int  left,
unsigned int  right,
unsigned int  top,
unsigned int  bottom 
)

Detects if the mouse is over an rectangular area of the screen.

If mouse hovering is set to false, then false is returned. This means, that the mouse is never above an object. Thus the function can be used, even if mouse hovering shouldn't be active.

Mouse coorinates begin in (0,0) at the top of the screen. Our coordinates begin at the bottom of the screen. Thus y-coordinates have to be turned over.

Definition at line 31 of file MouseHandler.cpp.

bool MouseHandler::isMouseOverRectCenter ( unsigned int  centerx,
unsigned int  centery,
unsigned int  width,
unsigned int  height 
)

Detects if the mouse is over an rectangular area of the screen.

If mouse hovering is set to false, then false is returned. This means, that the mouse is never above an object. Thus the function can be used, even if mouse hovering shouldn't be active.

Mouse coorinates begin in (0,0) at the top of the screen. Our coordinates begin at the bottom of the screen. Thus y-coordinates have to be turned over.

Definition at line 47 of file MouseHandler.cpp.

void MouseHandler::setHittedObject ( HitableObjects  object)

Definition at line 64 of file MouseHandler.cpp.

void MouseHandler::setHittedObjectInfo ( int  value)

Definition at line 68 of file MouseHandler.cpp.

void MouseHandler::setMouseHovering ( bool  status)

Definition at line 19 of file MouseHandler.cpp.

void MouseHandler::setMouseMoveEndPosition ( Position  endPosition)

Definition at line 92 of file MouseHandler.cpp.

void MouseHandler::setMouseMoveEndPosition ( int  x,
int  y 
)

Definition at line 96 of file MouseHandler.cpp.

void MouseHandler::setMouseMoveStartPosition ( Position  startPosition)

Definition at line 84 of file MouseHandler.cpp.

void MouseHandler::setMouseMoveStartPosition ( int  x,
int  y 
)

Definition at line 88 of file MouseHandler.cpp.

void MouseHandler::setMousePosition ( Position  position)

Definition at line 51 of file MouseHandler.cpp.

void MouseHandler::setMousePosition ( int  x,
int  y 
)

Definition at line 55 of file MouseHandler.cpp.


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