Using a the TileMap class actually solves the original problem of this post, as well as being faster, so I will definitely use them if possible
And when I said Quad pointer, I meant 4 vertex pointers (for each vertex of a quad), so the object can change the textureCoordinates to change what is being displayed (animation).
This is what I have as an example to loop over pieces of an animation, all part of a .png (4 states):
if (sf::Keyboard::isKeyPressed(sf::Keyboard::X))
{
textureTileX++;
if(textureTileX == 4)
textureTileX = 0;
quad[0].texCoords = sf::Vector2f(textureTileX * tileSize.x, textureTileY * tileSize.y);
quad[1].texCoords = sf::Vector2f((textureTileX + 1) * tileSize.x, textureTileY * tileSize.y);
quad[2].texCoords = sf::Vector2f((textureTileX + 1) * tileSize.x, (textureTileY + 1) * tileSize.y);
quad[3].texCoords = sf::Vector2f(textureTileX * tileSize.x, (textureTileY + 1) * tileSize.y);
}
Sorry if I didn't understand, but how do I get data from multiple files, for example:
The file "Gun_Type1.png" would ideally only hold the sprite sheet for that specific entity, while "Armor_Type2.png" would hold its own sprite sheet for a different entity. TileMap only lets me load one texture. How do I get around this?
Would I need multiple sf::VertexArrays and a corresponding sf::Textures in the TileMap, so that each call to
states.texture = loop over textures;
target.draw(loop over vertices, states);
would result in the correct texture being used, for the correct vertices? That doesn't seem like a good solution but it's the only one I have come up with.