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

Author Topic: Drawing sprites  (Read 940 times)

0 Members and 1 Guest are viewing this topic.

Scarlet500

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Drawing sprites
« on: December 12, 2017, 02:29:26 am »
Hello! I am doing a platformer in SFML and I am having some problems.

When drawing my sprites for the player and the enemies, only the background color for the enemies and the player textures are shown; not the actual details I have drawn onto them.

To make it more clear: My player sprite is a green square with a black ring inside it. The sprite for the player in-game has the exact same green color, but the black ring is missing? Same goes for the enemy sprites.
I am certain that I am loading in the correct textures, yet I get this weird result.

Has someone come across the problem before that could help me?

Thanks in advance!

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: Drawing sprites
« Reply #1 on: December 12, 2017, 06:56:47 am »
If you're using a texture atlas it's possible that you did not set the texture rect correctly and the window is just drawing a green portion of the image file for all sprites?

Or maybe the texture is not loading properly and you happened to set the sprite color to green?

Not really possible to tell without looking at the code.

 

anything