-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text input field UI component #6213
Comments
Added to the UI project board, replacing the existing empty text input placeholder there |
there is also the |
I think, a featured input element is very difficult to provide, since it has to handle so many things. I'd love to see At least:
And ideally:
|
I'm looking into this. It looks like glyph_brush_layout supports outputting the line height, which we will need to position the cursor vertically. For the horizontal positioning, I think we can just average the x position of adjacent characters to find the x position of the cursor. However, I don't know that bevy_text supports outputting that same line height information, so we likely need to make changes there. As for IME support, this is blocked on a stagnant winit initiative. |
Some experimentation here: https://github.com/wanderrful/yet-another-bevy-project/tree/experiment-7/src/ui/text_input Looks like it badly wants that IME support... Standard issues with "how do we create multi-entity assemblies" of course. Overall a good base to take inspiration from, even if the organization is not quite Bevy-idiomatic. |
Kayak UI has a text box that supports:
Some of the code is a bit messy, but I think it's a good starting point for a bevy UI implementation: |
Just dropping a few other third-party text input crates for folks coming to this issue looking for a solution, or for inspiration: https://github.com/StaffEngineer/bevy_cosmic_edit https://github.com/rparrett/bevy_simple_text_input |
I wanted to note that, close to a year later, I haven't found a good solution for text input yet. I ended up having to go with edit: All in all, I think it would be really nice if there was some work done towards the implementation of text input in Bevy. It's an important part of many games, especially multiplayer ones. Many could do without clipboard support. Many could do without IME support. But both would be incredibly nice to have. I only have some experience writing my own toy UI frameworks, I wouldn't know how to get either of the other crucial elements going. Perhaps separate projects (Bevy focused or not) would be the way to go? I've not found a dedicated clipboard crate that works on WASM. |
What problem does this solve or what need does it fill?
Provide a text field UI component which allows entering unicode text through the keyboard.
What solution would you like?
We will need focus handling and event routing to ensure only the focused text field receives the unicode character.
A framework for building/handling forms on top of the various input types would be great as well.
What alternative(s) have you considered?
Additional context
The text was updated successfully, but these errors were encountered: