SFML community forums

General => Feature requests => Topic started by: coolhome on March 21, 2011, 11:43:59 pm

Title: [Request] sf::Sprite Flip Methods
Post by: coolhome on March 21, 2011, 11:43:59 pm
Hello everyone,

After using SFML for a while now I realized the sf::Sprite::FlipX and FlipY doesn't really fit in with the rest of the sprite class. All of the other methods are mainly Get and Set. I think we should do a SetFlipX, SetFlipY, SetFlip (X + Y). Also add a GetFlipX and GetFlipY.

Also I don't know if this would be something else to add but when you flip a image also flip the origin with it. Maybe make that another method,,, I don't know lol
Title: [Request] sf::Sprite Flip Methods
Post by: Tank on March 22, 2011, 01:08:29 pm
I don't think they should be renamed to Set* and Get*. Compared to stuff like SetColor or SetPosition, FlipX/Y are operations and don't give access to properties (i.e. you "do" the flip, you don't set it).
Title: Re: [Request] sf::Sprite Flip Methods
Post by: Nexus on March 22, 2011, 05:28:33 pm
Quote from: "coolhome"
Also I don't know if this would be something else to add but when you flip a image also flip the origin with it. Maybe make that another method,,, I don't know lol
I don't think this is the responsibility of the sprite. On user side, you can achieve this by writing a global function.

Quote from: "Tank"
Compared to stuff like SetColor or SetPosition, FlipX/Y are operations and don't give access to properties (i.e. you "do" the flip, you don't set it).
That's not true. The names "FlipX/Y" are misleading, one might expect nullary functions representing actions. However these functions are setters: They assign the parameter to the internal state, but they do not regard the current state.

In case this should be changed, I propose "SetFlippedX/Y" and "IsFlippedX/Y".