bloodbarron115 Posted March 19, 2015 Share Posted March 19, 2015 I'm working on making a math game for kids and I am unsure of how to make the math problems appear on the screen and then making it so the keyboard can be used to answer the question. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
mwatt Posted March 19, 2015 Share Posted March 19, 2015 The easiest way is to throw up a JavaScript prompt box. But this does not look very nice at all. Probably best would be to position a div over a portion of your game and use regular HTML controls there. Link to comment Share on other sites More sharing options...
MichaelD Posted March 19, 2015 Share Posted March 19, 2015 I imagine you could have the html input hidden and simply invoke focus on it when the user is writing something and check the value of the input at "update" (with regular js or jquery). If I find time I will make a codepen to investigate this option. Edit: This is what I came up with, its not perfect but it should work. http://codepen.io/netgfx/pen/ogJZNO Link to comment Share on other sites More sharing options...
Recommended Posts