SFML community forums

Help => Graphics => Topic started by: CytraL on May 18, 2012, 06:35:09 am

Title: sf::Sprite SetSubRect Fail
Post by: CytraL 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:
http://youtu.be/a5-GGM6lUg0 (http://youtu.be/a5-GGM6lUg0)

What happens? thx!!

------------
P.S: Sry for my bad english :\
Title: Re: sf::Sprite SetSubRect Fail
Post by: Vovosunt 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);
Title: Re: sf::Sprite SetSubRect Fail
Post by: CytraL on May 18, 2012, 05:05:50 pm
Thx!! problem fixed ;)  sry for this stupid question.. :\