14 lines
455 B
C++
14 lines
455 B
C++
#include "buttonshape.h"
|
|
#include "glm/common.hpp"
|
|
|
|
RectangleButtonShape::RectangleButtonShape(glm::vec2 position, glm::vec2 dimension):ButtonShape(position),m_dimension(dimension)
|
|
{
|
|
|
|
}
|
|
|
|
bool RectangleButtonShape::hover(glm::vec2 mouse_position){
|
|
glm::vec2 pos = getPosition();
|
|
return (mouse_position.x >= pos.x && mouse_position.x < pos.x + m_dimension.x)
|
|
&& (mouse_position.y >= pos.y && mouse_position.y < pos.y + m_dimension.y);
|
|
}
|