Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
sf::Clock
Print
Pages: [
1
]
Author
Topic: sf::Clock (Read 1091 times)
0 Members and 1 Guest are viewing this topic.
ico170
Newbie
Posts: 3
sf::Clock
«
on:
May 06, 2013, 10:26:51 am »
hy i am trying to print the value of the sf::clock as text,can anybody help me with that because i cant convert it to string...
how to make the float in to a sf::string?
i am using sfml 2.0
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: sf::Clock
«
Reply #1 on:
May 06, 2013, 10:30:46 am »
Converting numbers to strings is a basic language feature, not something specific to SFML.
So: Google "C++ float to string"
Logged
Laurent Gomila - SFML developer
ico170
Newbie
Posts: 3
Re: sf::Clock
«
Reply #2 on:
May 06, 2013, 11:59:57 am »
i get the conversion but the clock doesnt want to print only text of current time but prints all the values beffore even if i put string.clear();
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: sf::Clock
«
Reply #3 on:
May 06, 2013, 12:05:57 pm »
Donc reuse the same stringstream. Either create a new one for every conversion, or call stringstream.str("") if you use the same instance.
Logged
Laurent Gomila - SFML developer
ico170
Newbie
Posts: 3
Re: sf::Clock
«
Reply #4 on:
May 06, 2013, 12:31:33 pm »
that will work
ty
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
sf::Clock