Please give more details (code, version of SFML, ...)
http://en.sfml-dev.org/forums/index.php?topic=5559.msg36367#msg36367
I apologize for not having read the rules before!
I'm using visual studio 2010 on a windows 7 32 bit OS with SFML v1.6
//TEXT CLASS HEADER
#pragma once
#include <SFML\Graphics\Font.hpp>
#include <SFML\Graphics\String.hpp>
#include <string>
#include <iostream>
class Text
{
public:
Text(std::string b, float _x, float _y); //takes a string to output and position coordinates
sf::Font myFont; //the font object
std::string a;
sf::String theText; //the string object
float x; //the x coordinate for the text to be printed
float y; //the y coordinate for the text to be printed
};
Text class cpp
#include "Text.h"
Text::Text(std::string b, float _x, float _y)
{
if (!myFont.LoadFromFile("Fonts/BAUHS93.ttf"))
{
std::cout<<"Error loading the text HURRRRR DURRRRR \n";
}
else
{
std::cout<<"TEXT SUCCESSS ERMAGERD \n";
}
this->a = b;
this->x = _x;
this->y = _y;
theText.SetFont(this->myFont);
theText.SetText("ERMAGERD");
theText.SetColor(sf::Color(0, 128, 128));
theText.SetPosition(200.f, 300.f);
theText.SetRotation(0.f);
theText.SetSize(50.f);
}
The code blow is a segment from the main where the game is being drawn. Right now theGame is an object in the main and the update loop is a member of it. Test is the name of the level object. Each level in the game is it's own object containing that level's respective data. The level objects are members of the Game class and test is a "test level". Hello is an object of the Text class from above and theText is a string object that is a member from the class above.
theGame, test, and hello objects as they appear in the snippet below are all pointers to the objects (I think)
When you put the cursor over the respective objects they appear as
"Game *theGame"
"Level *test"
"Text *hello"
"sf::String Text::theText"
theGame->draw();
if(theGame->test->isLoaded==true)
{
sf::String paddy = theGame->test->hello->theText;
App.Draw(paddy);
}
App.Display();