Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
[sfml 2] Take the text of the user.
Print
Pages: [
1
]
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
[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!
Logged
Laurent
Administrator
Hero Member
Posts: 32498
[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.
Logged
Laurent Gomila - SFML developer
player931402
Jr. Member
Posts: 51
[sfml 2] Take the text of the user.
«
Reply #2 on:
November 22, 2011, 09:43:35 pm »
Ty very much !
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
[sfml 2] Take the text of the user.