Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Write Number on the Screen  (Read 3196 times)

0 Members and 1 Guest are viewing this topic.

Mikea

  • Newbie
  • *
  • Posts: 28
    • View Profile
Write Number on the Screen
« on: February 01, 2009, 09:59:19 pm »
I'd like to write numbers on screen, like time and/or scores. How can I do that if sf::String only allows text.. ?
Check out my sfml games here

Astrof

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Write Number on the Screen
« Reply #1 on: February 01, 2009, 10:18:26 pm »

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Write Number on the Screen
« Reply #2 on: February 01, 2009, 10:31:17 pm »

Astrof

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Write Number on the Screen
« Reply #3 on: February 01, 2009, 10:37:24 pm »
yes there you go, a link to another topic on this forum ^_^

Mikea

  • Newbie
  • *
  • Posts: 28
    • View Profile
Write Number on the Screen
« Reply #4 on: February 02, 2009, 01:06:39 pm »
thank you :) although to update time this method only appends the text. I tryied to flush the stream but it keeps appending the numbers... example:

Score 1

Update

Score 12 instead of Score 2
Check out my sfml games here

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Write Number on the Screen
« Reply #5 on: February 02, 2009, 02:08:11 pm »
Tu remove the contents of a stringstream you have to call its str("") function, not clear() or flush().
Laurent Gomila - SFML developer

Mikea

  • Newbie
  • *
  • Posts: 28
    • View Profile
Write Number on the Screen
« Reply #6 on: February 02, 2009, 03:24:35 pm »
sweet THANKS :D
Check out my sfml games here