I have a 64 x 64 sprite of a block and I want to combine them inside the draw(sf::RenderTarget& target, sf::RenderStates states) method to create a texture of a wall of blocks depending on size.
At first I tried just using target.draw to draw each of the sprites individually, but the sprite.move method doesn't effect the target.
[
void Level::draw(sf::RenderTarget& target, sf::RenderStates states){
sf::Texture Tblock;
if (!Tblock.loadFromFile("block.png"))
exit(1);
sf::Sprite Sblock(Tblock);
sf::Texture level;
if (!level.create(getWidth()*64, getHeight()*64)) {
exit(1);
}
for(int y = 0; y < getHeight(); y++){
for (int x = 0; x < getWidth(); x++){
//draw sprite onto texture
//I don't know what to do here
}
}
sf::Sprite Level(level);
target.draw(Level);
}
]
Any help or hints would be appreciated. Thank you.