Text Entry

I have a game where I want to have the player enter their initials and email as a text box when they get a high scrore - I cant see an7y way of doing this - does WADE support text entry ?



All 2 Comments


There isn't a built-in way of doing this yet, manly because it's difficult to do it reliably cross-platform. If you want something that works everywhere including mobiles with small screens, I'd just use a plain javascript prompt, i.e.

var name = prompt('Enter your name');

But unfortunately you cannot style that, so it may be a bit ugly.

A more complicated (but still pretty reliable) way is to add an input element to the DOM, and focus it. This should trigger the virtual keyboard on a touch-screen device... whether it does that on all operating systems I don't know, I think that in some versions of iOS the user needs to physically touch that input box before the on-screen keyboard appears. On the plus side, you can style this with CSS to make it as pretty as you like.


OK - Thanks Gio - I'll give the basic one a go and see what it does.....


Post a reply
Add Attachment
Submit Reply
Login to Reply