I'm very new to programming. I am trying to set a Text variable in a class
class myclass
{
private:
Text m_name;
public:
void setName(Text name);
Text getName();
}
void setName(Text name)
{
m_name = name
}
Text getName()
{
return m_name;
}
in a .h file:
Text name;
Font font;
fond.loadFromFile(fonts/arial.ttf);
name.setFont(font);
name.setcharacterSize(12);
name.setFillColor(Color::White);
name.setPosition(x,y);
std::stringstream tname;
tname << x;
name.setString(tname.str());
myclass.setName(name);
Then basically I'm doing:
int main()
{
window.draw(name); //this comes back with an exception error
}
I think there's a problem with the font, but not sure. Any suggestions?