SFML community forums

Help => Graphics => Topic started by: Tigre Pablito on August 12, 2016, 10:54:16 pm

Title: I need to draw shapes and save to a file
Post by: Tigre Pablito on August 12, 2016, 10:54:16 pm
hi people from SFML

I need to draw a black square with a white (with alpha set) circle inside it and then save that to a file. I need this to make a light effect on my Super Mario game.  :D

I tried with image, circleshape, but wasn't able to find a method that pastes or draws the circle to the image. I know i could do this (without SFML) with window forms and .Net but i'm upset of Sin, Cos, and those.

Can you give me some code example?
Thanks  :)
Title: AW: I need to draw shapes and save to a file
Post by: eXpl0it3r on August 12, 2016, 11:14:26 pm
Draw to a render texture (see tutorial), copy to image (see documentation of sf::Texture), save image to disk.
Title: Re: I need to draw shapes and save to a file
Post by: Tigre Pablito on August 13, 2016, 03:00:36 am
Thanks, eXpl0it3r!

I solved the issue