This project is read-only.

Text Input / Silverlight + Xna Hybrid

Jul 11, 2009 at 11:48 PM

I am making a game that I want available on all of the following platforms (listed in order of importance):

Web Browser (Silverlight)



I have recently been trying to find a good solution for text input. Since Xna doesn't directly support buffered input (unless you are using the GamerServices keyboard blade) I have been looking at a lot of other's alternatives for doing buffered input. The most popular thing it seems for people to do is to use the Windows API for Windows games and to use the GamerServices keyboard blade for 360 games. Neither of these options work through Silversprite, certainly the Windows API is just unavailble for Silverlight and recently testing the keyboard blade showed that it doesn't show up at all. The keyboard blade is also graphically not what I want as it takes up about 1/2 of the entire window just to show a single textbox. For times when you need multiple pieces of data from the user, it can be cumbersome to the user to be prompted repeatedly for things just one at a time.

My first impulse after learning all of the above was to just create class that inherits from DrawableGameComponent that behaves as close to a Textbox as possible. This wouldn't provide for buffered input, but it shouldn't be too difficult for the user, and it would work in all 3 environments (I could also use "#if" for XBox360 input for the keyboard blade since it would probably be easiest for a user with a controller)

Before I move forward with this I wanted to follow up another idea / option I have thought of. Since Silverlight supports buffered input and supports it well, can anyone think of a way to make my game a Silverlight/Xna hybrid that will allow me to use Silverlight's strengths for text input and pass that information back to my Xna game? Ideally I would be able to do this on top of my running game and pass back the results to the game.

Thanks for all considerations everyone!