*

SDH

  • *
  • 19
    • View Profile
some changes
« on: 08 June 2014, 11:57:49 »
Well Hello,

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

Code: [Select]
setPosition(sf::Vector2f)
setSize(float,float)
can you change it to sf::Vector2 ?
because having functions with 2x floats & sf::Vector2f is confusing.

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

Code: [Select]
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
« Last Edit: 08 June 2014, 12:08:49 by SDH »

*

texus

  • *****
  • 1151
    • View Profile
    • Texus's Blog
Re: some changes
« Reply #1 on: 08 June 2014, 12:12:42 »
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

  • *
  • 19
    • View Profile
Re: some changes
« Reply #2 on: 08 June 2014, 12:17:35 »
sorry for that setGlobalFont looks like i missed sf::Font definition,
Have a nice day.