SFML community forums
General => Feature requests => Topic started 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
-
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).
-
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.
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".