Jump to content

Text Input?


soul
 Share

Recommended Posts

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. 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...