So I am trying to implement username system into my game and to do so I need to let the user input their desired username. I created a TextBox
class.
EDIT
Upon making a further research on other people's experience with the creation of a TextBox
in-game, and their approach I came to the following conclusions:
- My current code is badly designed because the
Microsoft.Xna.Framework.Input.Keys
andMicrosoft.Xna.Framework.Input.KeyboardState.GetState()
were never supposed to be used like this. - Because of that, the code is inefficient and would consume huge time and effort to do things that are otherwise insignificant because Windows handles them for you, when using
Winforms
. I will try to find a possible solution by working with some Win32 functions from theuser32.dll
. And probably useregexp
to validate strings.
Once I have it figured out, I'm going to revisit the current code and see what I can recycle and then, scrap the rest.