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

Author Topic: sf::Sprite SetSubRect Fail  (Read 1415 times)

0 Members and 1 Guest are viewing this topic.

CytraL

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • GitHub
sf::Sprite SetSubRect Fail
« on: May 18, 2012, 06:35:09 am »
Hi! i have one issue when i apply zoom and show sprites whit "SubRect" from image....

I use this to draw the sprite:
sf::Sprite SprTile;
SprTile.SetImage(*m_pMap->GetImage(pLayerTile->m_TexID));
SprTile.SetSubRect(sf::IntRect(TexX<<6, TexY<<6, (TexX<<6)+64, (TexY<<6)+64));
SprTile.Resize(32, 32);
SprTile.SetPosition(offsetX+pGroup->m_OffsetX+pLayerTile->m_OffsetX+(o<<5),offsetY+pGroup->m_OffsetY+pLayerTile->m_OffsetY+(u<<5));

m_pGUI->GetRenderWindow()->Draw(SprTile);
 

You can see the issue here:


What happens? thx!!

------------
P.S: Sry for my bad english :\
« Last Edit: May 18, 2012, 07:57:26 am by Laurent »
dev@redneboa.es | WordPress | GitHub | YouTube

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: sf::Sprite SetSubRect Fail
« Reply #1 on: May 18, 2012, 12:39:40 pm »
Looks like texture smoothing problem to me.
Try setting the smoothing on textures to false with setSmooth(false);

CytraL

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • GitHub
Re: sf::Sprite SetSubRect Fail
« Reply #2 on: May 18, 2012, 05:05:50 pm »
Thx!! problem fixed ;)  sry for this stupid question.. :\
dev@redneboa.es | WordPress | GitHub | YouTube

 

anything