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

Author Topic: SubRect  (Read 1677 times)

0 Members and 1 Guest are viewing this topic.

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SubRect
« on: September 09, 2011, 01:42:26 am »
Hi. I dont know if this is a bug on my part or yours, but there a problem with sprite.setsubrect(). When ever I change the subrect of the sprite, the whole image pops up on the screen. This is very brief, but Im changing the subrect constantly, so I pretty much see an opaque version of the whole image. Thanx in advance.

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
SubRect
« Reply #1 on: September 09, 2011, 02:10:28 am »
What version of SFML are you using? Second, you should show us some of the code to see if its not a problem with your coding.
CoderZilla - Everything Programming

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SubRect
« Reply #2 on: September 09, 2011, 04:49:06 am »
Im using 2.0. I know it works fine cuz ive been using the same code for a while from 1.6. All I did was cahange some things like textures instead of images, pollevent instead of getevent, etc. the base of the code is the same.

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
SubRect
« Reply #3 on: September 09, 2011, 05:51:11 am »
Quote from: "asdatapel"
Im using 2.0. I know it works fine cuz ive been using the same code for a while from 1.6. All I did was cahange some things like textures instead of images, pollevent instead of getevent, etc. the base of the code is the same.


I think I know what the problem is. Porting from SFML 1.6 to 2.0 using sf::IntRect has different arguments. It is no longer top, left, right, bottom. It now takes X, Y, width, height. Give that a try ;)
CoderZilla - Everything Programming