Adding text into a string while using SDL
Hey, I found a small delema in my venture to make an online game. Using Winsock for online play you have to manually enter in an IP address to connect. The problem I just ran into, all text runs straight to a text file called stout, how the heck could I not remember that? Anyways, is it possiable to create a text box that I could use to enter in the IP address? I sure as heck hope so. BTW, I havent even created a screen yet, I just created the network code.
Mark St. Jean - OwnerWastedInkVwmaggotwV@Yahoo.com
With SDL, it's very easy to get user input. Just check out the documentation.
December 20, 2004 07:43 PM
not sure what you mean, but you can simply use the + operator on strings to add them togeather.
so it'd be something like this
//poll the keyboard for key presses
strIP += strThekeyJustPressed
///write it out.
so it'd be something like this
//poll the keyboard for key presses
strIP += strThekeyJustPressed
///write it out.
Quote: Original post by Thrust
Hey, I found a small delema in my venture to make an online game. Using Winsock for online play you have to manually enter in an IP address to connect. The problem I just ran into, all text runs straight to a text file called stout, how the heck could I not remember that? Anyways, is it possiable to create a text box that I could use to enter in the IP address? I sure as heck hope so. BTW, I havent even created a screen yet, I just created the network code.
Not very easily its not. You would have to make your own custom library or use some screen widget to make a text box in SDL to enter text into. Loading the data via a file would be a lot easier in SDL. I hope this helps.
[edit] Accompishing what your asking in your second post is easy, just not making the text box, as you said in your first post.[/edit]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement