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.
project-kyoku/src/impl/sfml/textsfml.cpp

39 lines
794 B
C++

#include "textsfml.h"
TextSFML::TextSFML(sf::RenderTarget * const render_target,
const std::shared_ptr<const sf::Font>& font) :
_render_target(render_target)
{
_text.setFont(*font);
}
void TextSFML::setString(const std::string& string)
{
_text.setString(string);
}
void TextSFML::setCharacterSize(std::size_t pixels)
{
_text.setCharacterSize(pixels);
}
void TextSFML::setPosition(const kku::Point& point)
{
_text.setPosition(point.x, point.y);
}
void TextSFML::move(const kku::Vector2<float>& delta)
{
_text.move({delta.first, delta.second});
}
void TextSFML::setColor(const kku::Color& color)
{
_text.setFillColor(sf::Color{color.red, color.green, color.blue, color.alpha});
}
void TextSFML::display()
{
_render_target->draw(_text);
}