some changes

Started by SDH, 08 June 2014, 11:57:49

SDH

Well Hello,

I today started working with TGUI and i saw some things :D like:

setPosition(sf::Vector2f)
setSize(float,float)

can you change it to sf::Vector2 ?
because having functions with 2x floats & sf::Vector2f is confusing.

setText(sf::String)
to std::string ?
because sf::String crashes on empty string :
https://github.com/LaurentGomila/SFML/issues/389

setGlobalFont(std::string)
add support for sf::Font, because peoples like me have their own resources manager :)
and i know its just one font but, still.

feel free to insult [use criticism on] me :D

texus

There is also "setPosition(float, float)", so technically that is the default and the sf::Vector2f is just the extra one :). Even SFML still mixes these variants.
The one with the 2 floats has always been less limiting, you aren't forced to use a sf::Vector2f. But now with c++11 you could of course call the function like "setPosition({10, 10})" which makes the variant with floats unnecessary. So if I would redesign it then everything will indeed use sf::Vector2f. But this change will not be made in v0.6 because it breaks the api.

https://github.com/LaurentGomila/SFML/issues/5
You should just compile SFML with an extra flag, and then the crash with sf::String is fixed.
sf::String supports unicode while std::string doesn't, so I won't change it to std::string anyway.

There is another setGlobalFont function that takes a sf::Font as parameter.

SDH

sorry for that setGlobalFont looks like i missed sf::Font definition,
Have a nice day.