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

Author Topic: SubRect Problem  (Read 1355 times)

0 Members and 1 Guest are viewing this topic.

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
SubRect Problem
« on: May 05, 2013, 03:18:20 am »
SFML forum,
 SFML 1.6  Visual C++ 2010

 I have an png that is 64 x 320 and contains 5 sprite pictures.
 1 2 3 4    the last one is blank.

 If I use:
 Numbers.SetSubRect(sf::IntRect(0,0,63,63));
 Screen.Draw(Numbers);
 a 1 is dispayed.

 If I use:
 Numbers.SetSubRect(sf::IntRect(64,64,127,127));
 Screen.Draw(Numbers);
 nothing is dispayed.

 If I use:
 Numbers.SetSubRect(sf::IntRect(0,0,127,127));
 Screen.Draw(Numbers);
 1 2 is dispayed.

 etc.......

 I have successfully used the same png file in another IDE
 where all I have to do is set the frame number.

 I have attached the .png file.

 Any suggestions?

jerryd


[attachment deleted by admin]
« Last Edit: May 05, 2013, 03:28:00 am by jerryd »

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: SubRect Problem
« Reply #1 on: May 05, 2013, 03:42:24 am »
SFML forum,

 I solved this problem.

Jerryd

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: SubRect Problem
« Reply #2 on: May 05, 2013, 01:16:35 pm »
You should seriously stop using SFML 1.6, it's now officially and fully outdated.
SFML 2 has been released which fixes ALOT of bugs and introduces many new features. ;)
Also the tutorials are better.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything