SFML community forums
Help => Graphics => Topic started by: koolgraph on February 17, 2011, 04:05:16 pm
-
What should be done, getting some SetSubRect for Animating a sprite, or, giving the impression of animating it by replacing it with another sprite ?
I think it should be better to load more sprite since it takes a bit more memory, but i guess it saves some CPU.
-
In my opinion, creating many sprites is not a good option at all.
A good choice is to have one Sprite, and assign multiple images as you need them.
A even better way, is to have one sprite and one image, and use SubRect for changing the texcoords only :)
Spritesheets exist for a reason :)
-
SetSubRect is almost free, all it does is storing the sf::IntRect that you pass. It consumes no CPU.
-
i was planning using a spritesheet, i'm not that dumb XD that's why i asked for SetSubRect()
thanks Laurent, so i'll set up a list of rect.