SFML position d'un sprite
Bonjour, je n'arrive pas a positionner mon sprite dans la fenetre aux coordonnees voulu.
je donne la position 150 en x et 150 en y pourtant, mais il m'affiche le sprite a la position 0x 0y
Code:
1 2 3 4
| void SfmlDisplay::SetPosition(sf::Sprite objet, int x, int y)
{
objet.SetPosition(x, y);
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
void SfmlDisplay::SetImage()
{
LoadImage();
this->menu[0].SetImage(this->image[0]);
SetPosition(this->menu[0], 150, 150);
}
void SfmlDisplay::Display()
{
while (this->app.IsOpened())
{
this->app.Draw(this->menu[0]);
// this->app.Draw(this->menu[1]);
this->app.Display();
}
} |
pouvez vous m'eclairer ?