You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
868 B
C++
56 lines
868 B
C++
3 years ago
|
#include "group.h"
|
||
|
|
||
|
void Group::input(const sf::Event& event)
|
||
|
{
|
||
|
Widget::input(event);
|
||
|
}
|
||
|
|
||
3 years ago
|
void Group::update(const sf::Time& dt)
|
||
3 years ago
|
{
|
||
3 years ago
|
Widget::update(dt);
|
||
3 years ago
|
}
|
||
|
|
||
|
void Group::draw(sf::RenderTarget& target, sf::RenderStates states) const
|
||
|
{
|
||
|
Widget::draw(target, states);
|
||
|
}
|
||
|
|
||
|
void Group::setRect(const sf::FloatRect& rect)
|
||
|
{
|
||
|
_rect = rect;
|
||
|
}
|
||
|
|
||
|
void Group::setPosition(const sf::Vector2f& position)
|
||
|
{
|
||
|
_rect.top = position.y;
|
||
|
_rect.left = position.x;
|
||
|
}
|
||
|
|
||
3 years ago
|
void Group::move(const sf::Vector2f& delta)
|
||
|
{
|
||
|
_rect.top += delta.y;
|
||
|
_rect.left += delta.x;
|
||
|
|
||
|
Widget::move(delta);
|
||
|
}
|
||
|
|
||
3 years ago
|
bool Group::isUnderMouse(int mouse_x, int mouse_y) const
|
||
|
{
|
||
|
return _rect.contains(mouse_x, mouse_y);
|
||
|
}
|
||
3 years ago
|
|
||
|
sf::FloatRect Group::rect() const
|
||
|
{
|
||
|
return _rect;
|
||
|
}
|
||
|
|
||
|
sf::Vector2f Group::position() const
|
||
|
{
|
||
|
return sf::Vector2f
|
||
|
{
|
||
|
_rect.top,
|
||
|
_rect.left
|
||
|
};
|
||
|
}
|
||
|
|