Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: setTexture not working for sf::RectangleShape  (Read 2117 times)

0 Members and 1 Guest are viewing this topic.

Hodzo_V

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
setTexture not working for sf::RectangleShape
« 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...

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: setTexture not working for sf::RectangleShape
« Reply #1 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
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*