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

1 decade ago by baldeagle76

Right now in my game, I have a "sign" entity that (unsurprisingly) displays text. However, I&039;d like the user to be able to type text on it. I used <1> to capture a click event on the sign, but I don't know how I could just have the user type on his/her keyboard and have that be the text on the sign. I've considered two options: use a text field outside of the canvas element , take the text from that element in the #update() function and display it on the sign or bind an event to every single key on the keyboard with ig.input.bind. The first one I don't like because I don't think it'll work in Ejecta, and the second one just seems... cumbersome.

Any suggestions?

1 decade ago by Graphikos

Those really are the two solutions... unless you want to consider drawing your own on-screen keyboard where you present keys to click for entry. As far as Ejecta goes I think the only option, other than virtual keyboards, is to prompt with ejecta.getText().

/>			</div>
		</div>
			<div class=

1 decade ago by baldeagle76

I see, thanks. I'll probably just bind an event to each key, virtual keyboards are kind of a pain.

9 years ago by likethemammal

DaisywheelJS is also another option. It supports the HTML5 Gamepad API and makes it easy for developers to capture text from a user. Check it out!

/>			</div>
		</div>
	
	
<div class= Page 1 of 1
« first « previous next › last »