2024-04-08 22:45:00 -04:00
|
|
|
#include "UICaption.h"
|
2024-04-09 22:42:02 -04:00
|
|
|
#include "GameEngine.h"
|
2024-04-08 22:45:00 -04:00
|
|
|
|
|
|
|
|
UIDrawable* UICaption::click_at(sf::Vector2f point)
|
|
|
|
|
{
|
|
|
|
|
if (click_callable)
|
|
|
|
|
{
|
|
|
|
|
if (text.getGlobalBounds().contains(point)) return this;
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UICaption::render(sf::Vector2f offset)
|
|
|
|
|
{
|
|
|
|
|
text.move(offset);
|
|
|
|
|
Resources::game->getWindow().draw(text);
|
|
|
|
|
text.move(-offset);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PyObjectsEnum UICaption::derived_type()
|
|
|
|
|
{
|
|
|
|
|
return PyObjectsEnum::UICAPTION;
|
|
|
|
|
}
|