bardes bardes - 1 year ago 75
C++ Question

How to manipulate images with SFML?

I'm working on a game and I need to draw a sequence of tiles into a

, but the only way I could draw something into a
) was by editing the pixels directly.

I'd like to know if there is any function like the
or something like that in SFML. The only object I could draw things on was the

Am I doing something wrong or forgetting about something?

Answer Source

You can use sf::RenderTexture to call Draw functions with any drawable and take the result as a sf::Texture. You can then convert the sf::Texture to a sf::Image. Just take a look in documentation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download