soul Posted April 24, 2017 Share Posted April 24, 2017 What is the best way to make a Text Input? I've been researching for hours and trying so many things and can't seem to get a text input working at all. When using a regular HTML text input, the textbox seems to have focus if I click on it, but typing inside of it does nothing. I assume this is due to Pixi taking all input? How can I stop this? Better yet is there any Text Input that works directly inside Pixi? I seen some projects people created before for text input for Pixi, but those are extremely old and none of them work. I even tried to port them from Pixi v2, but with no luck. I also tried https://github.com/goldfire/CanvasInput but it seems to not work either with Pixi. I can get a text input showing up using a seperate canvas, but not Pixis. Quote Link to comment Share on other sites More sharing options...
TickleMeElmo Posted April 24, 2017 Share Posted April 24, 2017 First way would be to try fix this "When using a regular HTML text input, the textbox seems to have focus if I click on it, but typing inside of it does nothing", don't see why pixi would be somehow blocking the input, without the code, can't really say what's wrong either right now. Other way and in my opinion, better way, would be to just build a new text input for pixi. Add event listener for key up event and filter out all unwanted keystrokes, add registered key to stored string and just display that string as PIXI.Text. This way it's also quite easy to later on add some fancy stuff to the input. Rather weird though that there really isn't any decent Text Input for PIXI yet? Oo Shouldn't really be that much of work either, as it sounds quite interesting for me I think when having some free time and if any Input plugin isn't really done by then either, then will get my own hands dirty with it. Anyways, good luck with making the Input. Quote Link to comment Share on other sites More sharing options...
soul Posted April 25, 2017 Author Share Posted April 25, 2017 3 hours ago, TickleMeElmo said: First way would be to try fix this "When using a regular HTML text input, the textbox seems to have focus if I click on it, but typing inside of it does nothing", don't see why pixi would be somehow blocking the input, without the code, can't really say what's wrong either right now. Other way and in my opinion, better way, would be to just build a new text input for pixi. Add event listener for key up event and filter out all unwanted keystrokes, add registered key to stored string and just display that string as PIXI.Text. This way it's also quite easy to later on add some fancy stuff to the input. Rather weird though that there really isn't any decent Text Input for PIXI yet? Oo Shouldn't really be that much of work either, as it sounds quite interesting for me I think when having some free time and if any Input plugin isn't really done by then either, then will get my own hands dirty with it. Anyways, good luck with making the Input. Yeah I'll just go ahead and roll my own Text input then, thanks! Also, I'm stupid, I was calling .preventDefault in my current movement code, that's why the HTML input wasn't working... oops haha. EDIT: Just found this: https://github.com/limikael/PixiTextInput It works, but it's missing a lot of features, but a good place to start, I'll just add the features it's missing on it's TO-DO list. Quote Link to comment Share on other sites More sharing options...
Insi Posted April 25, 2017 Share Posted April 25, 2017 Also something works buggy in chrome since 4.4.1 (I don't check it on 4.5.x) Quote Link to comment Share on other sites More sharing options...
lachts Posted August 30, 2017 Share Posted August 30, 2017 Soul - did you have any luck with updates to https://github.com/limikael/PixiTextInput? Just about to work on the same problem myself and wondering if anyone's moved this project further forward? Thanks! Quote Link to comment Share on other sites More sharing options...
lednakashim Posted December 5, 2017 Share Posted December 5, 2017 I got the exact same issue - looking for a paradigmatic way to get styled text input for a game. Anybody got a work around? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.