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

Author Topic: Loading from file problem.  (Read 1006 times)

0 Members and 1 Guest are viewing this topic.

Pliskeviski

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Loading from file problem.
« on: September 02, 2017, 08:47:27 pm »
Hello! I have a problem here, I have .png that contains a circle, but when a "shoot", shows a square.
Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10884
    • View Profile
    • development blog
    • Email
Re: Loading from file problem.
« Reply #1 on: September 02, 2017, 09:01:09 pm »
See The White Square Problem as described in the tutorial: https://www.sfml-dev.org/tutorials/2.4/graphics-sprite.php#the-white-square-problem

tl;dr don't copy the texture and make sure it doesn't run out of scope as long it's used
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Pliskeviski

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Loading from file problem.
« Reply #2 on: September 02, 2017, 09:33:56 pm »
Thanks! It's working.