Skip to content

Commit

Permalink
Text outline support!
Browse files Browse the repository at this point in the history
Thanks sfml
  • Loading branch information
imerr committed Apr 22, 2018
1 parent bc0a41c commit 9e44961
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/Engine/Text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ namespace engine {
}

const sf::Color& GetColor() {
return m_text.getColor();
return m_text.getFillColor();
}

void SetColor(const sf::Color& color) {
m_text.setColor(color);
m_text.setFillColor(color);
}

protected:
Expand Down
6 changes: 5 additions & 1 deletion src/Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ namespace engine {
m_font.loadFromFile(text.get("font", "").asString());
m_text.setFont(m_font);
m_text.setCharacterSize(text.get("size", 30).asUInt());
m_text.setColor(jsonNodeAs<sf::Color>(text["color"]));
m_text.setFillColor(jsonNodeAs<sf::Color>(text["color"]));
if (!text["outline"].isNull()) {
m_text.setOutlineColor(jsonNodeAs<sf::Color>(text["outline"]));
m_text.setOutlineThickness(text.get("outline_thickness", 1).asFloat());
}
auto align = text["align"];
if (align.isString()) {
const std::string& a = align.asString();
Expand Down

0 comments on commit 9e44961

Please sign in to comment.