1
Graphics / setTextureRect() or setTexture()
« on: February 12, 2013, 09:03:11 pm »
Hi
sorry, if this question is already answered, but I got a database error while using the search function...
I'm just switched to SFML 2 and currently I'm reading through the documentation. The new way to use sf::Sprite with sf::Texture instead of sf::Image seems very interesting to me.
But here is my question:
If I want to implement an animation, would it be better have several sf::Texture's and switch the images from the animation with sf::Sprite::setTexture().
Or is the better way to have one large sf::Texture containing all the animation images and then, each time the image should change, calling the function sf::Sprite::setTextureRect().
thanks and I apologize for my bad english
sorry, if this question is already answered, but I got a database error while using the search function...
I'm just switched to SFML 2 and currently I'm reading through the documentation. The new way to use sf::Sprite with sf::Texture instead of sf::Image seems very interesting to me.
But here is my question:
If I want to implement an animation, would it be better have several sf::Texture's and switch the images from the animation with sf::Sprite::setTexture().
Or is the better way to have one large sf::Texture containing all the animation images and then, each time the image should change, calling the function sf::Sprite::setTextureRect().
thanks and I apologize for my bad english