I am using SFML 2.1 and have an Image with some objects that I would like to number, i.e. I have a set of origin coordinates for each of them so I would place the number there.
However, I can't seem to find a good way to do this: the most relevant function seems to be Image::copy()
which places a rectangle in the image. To use that, I would have to create a number map image and then do offsets for successive numbers, which seems tedious, cumbersome and unreliable, as an image with too many objects would eventually run out of numbers.
I also thought of conceivably using a RenderWindow
object and printing the Image along with numbers as sf::Text
objects with the right coordinates, but the API does not seem to provide a way to save the contents of the window to an image.
So the question is: is there a straightforward way to place numbers (text in general) in an Image
object?