SFML community forums

Help => Graphics => Topic started by: ERROR on April 21, 2013, 01:40:20 pm

Title: small part of an image
Post by: ERROR on April 21, 2013, 01:40:20 pm
Hey,

I am trying to make a button and the letters should be taken from a big image. I already have the image with the whole alphabet in it. My problem is that I don't know how to make a small sprite out of the big one.

Hope somebody can help me with that problem.
Title: Re: small part of an image
Post by: zsbzsb on April 21, 2013, 01:49:22 pm
Please refer to the documentations and tutorials and this problem can easily be solved.
See this for what you need. (http://sfml-dev.org/documentation/2.0/classsf_1_1Sprite.php#a3fefec419a4e6a90c0fd54c793d82ec2)
Notice the setTextureRect.
Title: Re: small part of an image
Post by: ERROR on April 21, 2013, 02:12:18 pm
Thanks ;).

I knew it would be really easy, but I just didn't know which function I had to use.


Thanks again.