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

Author Topic: [sfml 2] Take the text of the user.  (Read 1804 times)

0 Members and 1 Guest are viewing this topic.

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
[sfml 2] Take the text of the user.
« on: November 22, 2011, 08:21:47 pm »
Hi guy!
I have a doubt!
In my game I need to ask for the name of the player.
How do I take (and visualize) the name of the player?

For example:

-- step 1 --
the player type "S"
On the screen : S
-- step 2 --
the player type "F"
On the screen : SF
-- step 3 --
the player type "M"
On the screen : SFM
-- step 4 --
the player type "L"
On the screen : SFML
-- step 5 --
the player type "Enter"
i save "SFML" in a std:: ( or sf:: ) string called "NamePlayer".



got it?


Soz for my orrible eng!
B!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[sfml 2] Take the text of the user.
« Reply #1 on: November 22, 2011, 08:58:42 pm »
To get typed characters, you need to catch the TextEntered event.

To display them, you must use sf::Text.
Laurent Gomila - SFML developer

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
[sfml 2] Take the text of the user.
« Reply #2 on: November 22, 2011, 09:43:35 pm »
Ty very much ! :)