SFML community forums
Help => Graphics => Topic started by: mihaineken on November 17, 2013, 11:37:08 am
-
So I have my class :
class myClass{
private :
sf::Sprite my_sprite;
public :
void set_position( sf::Vector2f my_vector ) { my_sprite.setPosition( my_vector ); }
}
in main I have :
myClass class ;
sf::Vector2f someVector ;
someVector.x = (float) 50 ;
someVector.y = (float) 100 ;
class.set_position( someVector ) ; //DOES NOT WORK. WHEN I DRAW THE OBJECT , THE POSITION IS STILL 0, 0
-
Could make a complete example, the given pieces should set the position of the sprite correctly, but it might not get used right at some other places. :)
-
the class is in another file.
if I declare in main a sprite and set the position to someVector, it change the position correctly.
-
Your problem description is very unclear. Please read this thread (http://en.sfml-dev.org/forums/index.php?topic=5559.0) (especially the part about the minimal complete example) so that we understand you :)
-
I don't know what I've done wrong.
I've remade the example with minimum code and it work's fine ...
Thank you guys !