Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Is there a way to flip a sprite on the x or y axis?  (Read 4305 times)

0 Members and 1 Guest are viewing this topic.

esrix

  • Newbie
  • *
  • Posts: 5
    • View Profile
Is there a way to flip a sprite on the x or y axis?
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Is there a way to flip a sprite on the x or y axis?
« Reply #1 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.
Laurent Gomila - SFML developer

esrix

  • Newbie
  • *
  • Posts: 5
    • View Profile
Is there a way to flip a sprite on the x or y axis?
« Reply #2 on: October 05, 2007, 05:06:40 am »
Happy to hear your considering it :)

Pepeshka

  • Newbie
  • *
  • Posts: 1
    • View Profile
Is there a way to flip a sprite on the x or y axis?
« Reply #3 on: October 19, 2007, 12:02:35 am »
You could use the getpixel and setpixel functions of Image to manually flip an axis...

 

anything