Hey guys, I'm trying to display some text in my game but I keep getting the error displayed in the image I have attached coming up, the font is not null, nor the character size, nor the test or colour, what am I doing wrong here?
Here is the render code
//Objects and text
for (int i = 0; i < DisplayObjects.size(); i++)
{
auto object = DisplayObjects.at(i);
Window.draw(object->GetSprite());
if (object->IsTextObject())
{
Window.draw(object->GetText());
}
}
Also here is the code I have which sets up the text
void DisplayObject::SetText(std::string setText)
{
displayText.setFont(font);
displayText.setColor(sf::Color(0, 0, 0));
displayText.setCharacterSize(24);
displayText.setString(text);
text = setText;
textObject = true;
}