Hello there people,
I'm having a little problem with populating a sprite, but when attempting to draw the sprite I get a n error in the RenderWindow Draw function.
Here is the code that I am using to pull back my character object to draw
std::vector<CharacterObject*> State::GetCharacters()
{
std::vector<CharacterObject*> characters;
for (auto character : Characters)
{
characters.push_back(&character);
}
return characters;
}
Inspecting &character the variable you can see the spriteSheet is set up, just to make it clear the spriteSheet is a sheet of sprites, so basically the sprite is is setup at the moment to just draw the spriteSheet, here is the sprite setup code
void CharacterObject::Setup()
{
sprite.setTexture(spriteSheet);
}
But in the image the sprite seems to not be set, is this due to me passing a pointer around or am I setting the sprite wrong?
Here is an image below.