Hi, half a year ago I posted in
this thread (the second page is relevant). My concern was to clean some of the inconsistences in member function names and to make the interfaces more uniform.
For example, sf::String and sf::Sprite are somehow accessed quite differently, although they have many functionality in common.
- sf::Sprite::GetSize() returns a sprite's width/height.
- In contrast, sf::String::GetSize() returns the character size. I would appreciate something like the font's method GetCharacterSize(), in my opinion that was clearer.
- Instead of GetSize(), there is a GetRect() function at strings, but not at sprites. I'd prefer a GetSize() method like at sprites.
Or sf::View:
- GetRect() to get the rectangle on the screen
- GetCenter() and GetHalfSize() to get two 2D-Vectors which contain the same information as the rect.
Accessing the width and height:
- sf::RenderWindow, sf::Rect, sf::Image have got GetWidth() and GetHeight() functions.
- sf::Sprite has got a GetSize() method.
Here I think that is quite okay, since sprites are used in coordinate systems of the screen. But the sf::Rect seems to me sometimes a little bit questionable (for example at sf::String or sf::View), especially when they can easily be replaced by 2D-vectors. In my honest opinion, sf::String should get a GetSize() method and lose the GetRect() method instead. There is no loss of information as long as there are GetCenter(), GetPosition() and GetSize().
What do you think about those identifiers?