SFML community forums

Help => Graphics => Topic started by: esrix on October 04, 2007, 02:05:46 pm

Title: Is there a way to flip a sprite on the x or y axis?
Post by: esrix on October 04, 2007, 02:05:46 pm
I was wondering if there is a way to flip a sprite on the x or y axis.  For example, if the image of a sprite appeared to be facing left, is there a way to flip it on the x axis to make it appear to be facing right?

I looked through the documentation to see if I could invert the x or y scale, but it states that a sprite's scale values must be strictly positive.

I know how to do it by setting a quad and scaling it in OpenGL, but I was wondering if SFML was capable of doing it.
Title: Is there a way to flip a sprite on the x or y axis?
Post by: Laurent on October 05, 2007, 03:47:46 am
There is currently no way to do it, but I'll think about it. Maybe allowing negative scales will be enough.
Title: Is there a way to flip a sprite on the x or y axis?
Post by: esrix on October 05, 2007, 05:06:40 am
Happy to hear your considering it :)
Title: Is there a way to flip a sprite on the x or y axis?
Post by: Pepeshka on October 19, 2007, 12:02:35 am
You could use the getpixel and setpixel functions of Image to manually flip an axis...