1
Graphics / Sprite Container/ Combiner?
« on: January 27, 2013, 12:27:49 pm »
So I'm new to the wonderful world of SFML.
I'm making an isometric tile engine as my first project.
Problem I'm having is I want to combine all the tiles I draw into one object.
That way the map moves all as one piece once rendered.
How would I go about making this said "container"?
My current map rendering system looks like this:
I'm making an isometric tile engine as my first project.
Problem I'm having is I want to combine all the tiles I draw into one object.
That way the map moves all as one piece once rendered.
How would I go about making this said "container"?
My current map rendering system looks like this:
Code: [Select]
// image already loaded in to textureVector[x], mapVector[x][y] is the map in zeros and ones
Sprite tileSprite;
for(int i = 0; i < MapVector.size(); i++)
{
for(int j = 0; j < MapVector[i].size(); j++)
{
tileSprite.setTexture(textureVector[MapVector[i][j]]);
tileSprite.setPosition((j * BLOCKSIZE / 2)-(i * BLOCKSIZE /2)+40, (j * BLOCKSIZE / 4)+(i * BLOCKSIZE /4)+40);
tileSprite.setRotation(45);
Window.draw(tileSprite);
}
}