I wanted to draw sprites on screen having only information about it in my struct and next draw text on it
Information are good X and Y scale=1 Path is good and point to graphic position and rotation =0;
int free have a good number
But Text works so i don't know why Sprite don't
I tried commenting code with drawing and making text don't work
struct ObjectInfo
{
float Xpoz,Ypoz;
std::string TexPath;
float Xscale,Yscale;
float Rotation;
};
ObjectInfo OI[1000];
int free;
void Draw()
{
for(int i=0;i<free;i++)
{
sf::Texture t;
t.loadFromFile(OI[i].TexPath);
sf::Sprite s;
s.setTexture(t);
s.setPosition(OI[i].Xpoz,OI[i].Ypoz);
s.setScale(OI[i].Xpoz,OI[i].Ypoz);
s.setRotation(OI[i].Rotation);
okno.draw(s);
sf::Text text;
text.setFont(font);
text.setCharacterSize(48);
text.setColor(sf::Color::Black);
text.setPosition(s.getPosition());
text.setString(IntToString(i));
okno.draw(text);
}
}
I expected that sprites and Text display but only text display