SFML community forums

Help => Graphics => Topic started by: PixelMuffin on July 10, 2012, 08:35:09 pm

Title: SFML equivalent of SDL Blitting?
Post by: PixelMuffin on July 10, 2012, 08:35:09 pm
Hi. I am working on my first SFML project and I am trying to figure out how to create a sprite using an x, y, width and height source from a texture.

For my example, I am working on a menu system with text and I would rather not save 20 different individual text images. Is such an operation possible in SFML?

Thanks!
Title: Re: SFML equivalent of SDL Blitting?
Post by: Laurent on July 10, 2012, 08:36:45 pm
The sprite can show a sub-rectangle rather than the entire texture. Use Sprite::setTextureRect.
Title: Re: SFML equivalent of SDL Blitting?
Post by: PixelMuffin on July 10, 2012, 11:48:47 pm
Thank you Laurent. You do fantastic work! :D
Title: Re: SFML equivalent of SDL Blitting?
Post by: Laurent on July 11, 2012, 08:18:23 am
Quote
You do fantastic work!
The online doc does an even more fantastic job :)