I wonder if I should just make a thread for all my queries here to be honest
I'm trying not to spam the forum but I've run into annoying problem with sf::Text. I thought I'd try it out since I'm still working on the other problem in my head but I found that no matter what I try the command isn't declaring my objects properly.
#include <Iostream>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode( 800, 600 ), "C++ Programming Test");
sf::Font arial;
if ( !arial.loadFromFile ( "arial.ttf" ) )
sf::Text lineone;
lineone.setFont( arial );
lineone.setString ( "SFML Text is working!" );
lineone.setCharacterSize ( 12 );
lineone.setPosition ( 400, 300 );
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw ( lineone );
window.display();
}
return 0;
}
|15|error: 'lineone' was not declared in this scope
It's clearly complaining about me naming my text but the problem is I can't see where I've gone wrong, I think I need a fresh pair of eyes to just have a look over it. I've probably missed something really obvious like a typo or the way it's laid out.