SFML community forums

Help => Graphics => Topic started by: Hodzo_V on December 05, 2019, 06:41:20 pm

Title: setTexture not working for sf::RectangleShape
Post by: Hodzo_V on December 05, 2019, 06:41:20 pm
I tried to set a texture to a rectangle shape, so I needed an sf::Texture and obviously an sf::RectangleShape. But after I set the texture via rectangle.setTexture(&texture) and ran the code, I saw nothing. I was doing everything like was written in the doc. Help me to find my mistake, please...
Title: Re: setTexture not working for sf::RectangleShape
Post by: Hapax on December 05, 2019, 10:48:19 pm
Hello!

It looks like the line of code you posted is correct so there will need to be a bit more context about what other code you have that might be going wrong, what exactly you are expecting and which texture you are using.

The best way to get help is to provide a complete and minimal example of this problem occuring and the solution would probably be quickly spotted by someone or even you, once it's minimalised!

Read this post for more information on "complete and minimal example":
https://en.sfml-dev.org/forums/index.php?topic=5559#msg36368