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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - neml

Pages: [1]
1
General / Re: Convert user input to integer (SFML 2.0)
« on: May 03, 2015, 09:03:59 pm »
sf::String is implicitly convertible to std::string. Then the std::string to int conversion is a trivial thing in C++, that you can easily learn to do with the help of Google.

Thank you! I hadn't realized sf::String was convertible to std::string

2
General / Convert user input to integer (SFML 2.0)
« on: May 03, 2015, 08:50:27 pm »
Hi guys! :)

I'm starting to develop my first game, and I need the user to enter his/her age before the game itself starts, as I need the age to calculate other game parameters.

The numbers entered are being stored in an sf::String, so that they can be displayed, but I don't know how to convert them from sf::String to int.

At first I thought about using an std::string and then converting to int with atoi, but I'm not sure I can display text if it's not of type sf::String :-\ .

Any ideas?

Pages: [1]
anything