Yes. The following works (latest development version from GitHub):
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application");
window.setFramerateLimit(20);
sf::Font font;
font.loadFromFile("sansation.ttf");
sf::Text text("hello\nworld", font, 40);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::KeyPressed || event.type == sf::Event::Closed)
return 0;
}
window.clear();
window.draw(text);
window.display();
}
}
text.setString(std::get<0> (tuplePar)); //the string is "hello\nworld", same as below
text.setString("hello\nworld");
First example is trying to to set it as a string from a file, and the string gets read correctly( it displays the right thing) but doesnt seem to work.
second example is setting it manually to the exact same string and it works. What's up?
"hello\nworld" is the actual string. I wonder if it's getting stripped of its escape sequence properties or something, getting reduced to just flat text. Is that even possible?
I did something like:
goodString.compare(badString);
And the output is -1, so they can't be the same
Also: It's read as a newline in characters. I tried using \\n but it's the same thing :(