bevy_text_edit


A very easy-to-use plugin for input text in Bevy. Good enough for game setting and command console.
Features:
- Switchable between multiple text boxes.
- Moving the text cursor using arrow keys and Home/End.
- Limit input length.
- Filter input text with regex.
- Placeholder.
- Paste with
Ctrl+v. - In-game virtual keyboard.
- Repeated key.
Not support:
- IME.
- In-game virtual keyboard.
- Multi-language.
- Select text.
- Copy.
Quickstart
Plugin
Add plugin TextEditPlugin to the app and define which states it will run in:
If you don't care to game state and want to always run input text, use TextEditPluginAnyState:
Component
Insert component TextEditable into any text entity that needs to be editable:
Only text focused by clicking gets keyboard input.
It is also possible to limit which characters are allowed to enter through filter_in and filter_out attribute
(regex is supported):
Get text
The edited text can be retrieved from event or observe trigger TextEdited.
// Get by event
// Get by observing
License
Please see LICENSE.
Compatible Bevy Versions
| bevy | bevy_text_edit |
|---|---|
| 0.17 | 0.7 |
| 0.16 | 0.6 |
| 0.15 | 0.4-0.5 |
| 0.14 | 0.1-0.3 |
| 0.13 | 0.0.1-0.0.5 |