Hey guys, I’m working on this text adventure game (I know, what a waste of PlayCanvas’ 3D engine) and ran into a problem when testing it on my tablet. The mobile keyboard doesn’t pop up. How would you go about getting the mobile device keyboard to popup? Here is my latest build: https://playcanv.as/p/Jk8YVjVg/
Unfortunately Play Canvas doesn’t have an input box.
It means that the only option you have is to use an html node placed over the canvas. It’s not the easiest thing expecially if you want to place it aligned to other elements rendered in the canvas.
Are you sure that is really the only option? Isn’t there a way to make the keyboard pop up thru code. I already have the code in place to capture the keystrokes so I don’t really need an input box, all I need is for the keyboard to show up. The way I’ve set this up, I’m capturing keystrokes independently of the “command line”, meaning that even on the PC you don’t need to first click on the command line and then type. The game captures keystrokes and display them on the command line no matter where you are clicking. In fact the mouse serves absolutely no purpose. I’ve basically coded my own “input box”.
I think it might be a browser limitation that requires a text input field for the keyboard to show.
You can create a hidden text input field in HTML and give it focus on start? That should force the keyboard to show on mobile browsers.
Great. Can you share the code of your “input box” ? Have you implemented cursor positioning. Mean if i click on center of my input string the input control (cursor) should set to that position ?
Haven’t touched this project in about a year but here is link to the repo.
If I recall, the entire game was keyboard based, so no way to click with the mouse to position the cursor.