SFML community forums

Help => Graphics => Topic started by: jerryd on May 05, 2013, 03:18:20 am

Title: SubRect Problem
Post by: jerryd 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]
Title: Re: SubRect Problem
Post by: jerryd on May 05, 2013, 03:42:24 am
SFML forum,

 I solved this problem.

Jerryd
Title: AW: SubRect Problem
Post by: eXpl0it3r 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.