ok so here is my code:
(i am using the resource manager to manage images found in the wiki)
sf::Image* image = gImageManager.getResource( tilesetfilelocation );
if( image != NULL )
{
sf::Sprite sprite;
sprite.SetImage( *image );
sprite.SetSubRect(sf::IntRect(32, 32, 32, 32));
sprite.SetCenter(0,0);
sprite.SetPosition((float)32,(float)32);
map.push_back(sprite);
}
else
cout << "File not found! " << tilesetfilelocation << endl;
my problem is that when is when i comment out this, and draw all the sprites (map is a vector array of sprites)
sprite.SetSubRect(sf::IntRect(32, 32, 32, 32));
it draws the entire image fine. but when i attempt to draw one tile from this by leaving the above line UNcommented i get nothing.
i cant get SetSubRect to work for the life of me.
the image i am using is a tile set with 32x32 tiles in jpg format, one used by rpgmaker.
any ideas?