The code is all over the place.. i hope thats not a problem..
main.cpp
int main()
{
/// Create the main window
sf::RenderWindow App;
App.Create(sf::VideoMode(SCREENWIDTH, SCREENHEIGHT, 32), "SFML Window", sf::Style::Fullscreen);
CText Text;
....
....
Text.Plot(App,"UITILE", 200,0,128,200,10,15);
text.h
class CText {
private:
sf::String TextString;
sf::Font Font;
public:
CText();
~CText();
///Create text string with size and color
void Plot(sf::RenderWindow& App, char text[10], int r, int g, int b, int x, int y, int size=20);
};
text.cpp
#include "Text.h"
CText::CText()
{
Font.LoadFromFile("cheeseburger.ttf");
sf::String TextString(L"",Font);
}
CText::~CText()
{
}
void CText::Plot(sf::RenderWindow& App, char text[10], int r, int g, int b, int x, int y, int size)
{
//sf::String TextString(L"",Font);
TextString.SetText(text);
TextString.SetSize(size);
TextString.SetColor(sf::Color(r,g,b));
TextString.SetPosition(x,y);
App.Draw(TextString);
}
If i uncomment the sf::String TextString(L"",Font); line in the Plot function, then the cheeseburger.ttf font is used, else the default font is used.