Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

5 years ago by SirPereira

I was wondering how canvas text inputs should work in mobile (iOS or Android).

Is there anyway to call directly the mobile virtual keyboard interface by using some JavaScript?

I would prefer it instead of creating a virtual keyboard at all (as we don't even know the characters of the keyboard of the people we are building the game to).

Any suggestions on how to handle this?

5 years ago by stahlmanDesign

Good question. If the mobile keyboard is only triggered by a DOM element, like <input>, I don't think it would be supported in Ejecta. If you are viewing the game on a mobile browser, it would still take some tricks to force the keyboard to open because it since the <canvas> is its own tag, and you can't have an <input> inside it.

5 years ago by TC

if using Ejecta you can use the api below to get user entered text.

var userText;

ejecta.getText( 'Highscore', 'Please enter your name', function(text) {
    userText = text;
});
Page 1 of 1
« first « previous next › last »