Crate bevy_simple_text_input
source ·Expand description
A Bevy plugin the provides a simple single-line text input widget.
§Examples
See the examples folder.
use bevy::prelude::*;
use bevy_simple_text_input::{TextInputBundle, TextInputPlugin};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(TextInputPlugin)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
commands.spawn((NodeBundle::default(), TextInputBundle::default()));
}
Structs§
- A bundle providing the additional components required for a text input.
- A component containing the current text cursor position.
- A component that manages the cursor’s blinking.
- If true, the text input does not respond to keyboard events and the cursor is hidden.
- A component containing the placeholder text that is displayed when the text input is empty and not focused.
- A Bevy
Plugin
providing the systems and assets required to make aTextInputBundle
work. - A component containing the text input’s settings.
- An event that is fired when the user presses the enter key.
- The Bevy
TextStyle
that will be used when creating the text input’s inner BevyTextBundle
. - A component containing the current value of the text input.