1
Graphics / [Solved] Problem with sf::sprite.SetImage problem
« on: May 08, 2009, 07:23:42 pm »
Ah, I forgot sprite is just a pointer to image :/ Sorry for your waste of time
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
sf::Image Image;
// Create the sprite
sf::Sprite Sprite[20][20];
int temp;
fin >> temp;
if (temp == 1)
{
if (!Image.LoadFromFile("s596.bmp"))
{
fout << "Error s596.bmp" << std::endl;
}
else
{
fout << "s596.bmp loaded" << std::endl;
}
Sprite[i][j].SetImage(Image);
}
if (temp == 2)
{
if (!Image.LoadFromFile("s543.bmp"))
{
fout << "Error s543.bmp" << std::endl;
}
else
{
fout << "s543.bmp loaded" << std::endl;
}
Sprite[i][j].SetImage(Image);
}
Sprite[i][j].SetPosition(0.f+(32*j), 0.f+(32*i));