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

Author Topic: SetSubRect()?  (Read 2032 times)

0 Members and 1 Guest are viewing this topic.

Grimlen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
SetSubRect()?
« on: October 01, 2012, 10:07:32 pm »
I noticed in SFML 2.0 the setSubRect() function appeared to be dropped from the sf::Sprite class...?
How exactly would I set a sub-rectangle of an sf::texture in order to animate it in SFML 2.0?

You could do this in 1.6 but it appears to have disappeared.

Example:
sf::Texture tex;
sf::Sprite spr;
..
spr.setTexture(tex);
spr.setSubRect() ... //non-existing in 2.0
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10818
    • View Profile
    • development blog
    • Email
Re: SetSubRect()?
« Reply #1 on: October 01, 2012, 10:13:39 pm »
A quick look at the documentation should've given it away. ;)

void setTextureRect (const IntRect &rectangle)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything