SFML community forums

Help => General => Topic started by: idontmakesense on February 26, 2014, 11:02:24 am

Title: How to Delete/Remove Sprite?
Post by: idontmakesense on February 26, 2014, 11:02:24 am
mySprite.setTexture(NULL) gives syntax error.

Any alternatives?
Title: Re: How to Delete/Remove Sprite?
Post by: Rhimlock on February 26, 2014, 11:05:34 am
You dont have to Remove a sprite.

What do you want to achive by doing something like that?
Title: Re: How to Delete/Remove Sprite?
Post by: Nexus on February 26, 2014, 11:07:19 am
You should probably learn basic C++ instead of trying random things. You can remove something from another data structure like an STL container, but not "on its own".
Title: Re: How to Delete/Remove Sprite?
Post by: idontmakesense on February 26, 2014, 11:13:25 am
Sorry to be unclear. Its my first attempt making a game and coding on sfml.

I have a "car sprite" which on collision with a "bullet sprite" should, well, for now disappear/get removed/get deleted.
 
Any help on how to achieve that?
Title: Re: How to Delete/Remove Sprite?
Post by: eXpl0it3r on February 26, 2014, 11:17:38 am
If it shouldn't appear on the screen anymore, don't draw it to the screen. And yes, acquire a solid C++ understanding first. ;)