Input Field
Janne

Is there any possible to make text input fields in wade? Like for login form to the game etc...

1 Comment
Gio

Hi

We did this in a couple of different ways in our WADE games, and I think it ultimately depends on what you want to achieve with it.

The most reliable way is to just add a DOM element to the page (an <input> element that is). Scaling and positioning it with css so it always appears in the right position is a bit tricky though.

A much easier alternative is to have a clickable SceneObject that just calls the prompt() function... that will take a minute to code and is guaranteed to work everywhere, but it doesn't really look nice because you can't style the prompt window.

On Zirma we have made a custom behavior to show a text box (made with a few sprites) on desktop, and fall back to prompt() on (most) mobile operating systems. You can try to start a multiplayer game to see that in action.

I have attached the behavior file here, but it was made with a very old version of WADE (0.8 if I remember correctly), and as such it's unlikely to work out of the box with the newest version. It might though, so it could be worth a try :)

 

Post a reply
Add Attachment
Submit Reply
Login to Reply