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::{TextInput, TextInputPlugin};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(TextInputPlugin)
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn(Camera2d);
    commands.spawn((
        TextInput,
        Node {
            padding: UiRect::all(Val::Px(5.0)),
            border: UiRect::all(Val::Px(2.0)),
            ..default()
        },
        BorderColor(Color::BLACK)
    ));
}

Structs§

TextInput
The main “driving component” for the Text Input.
TextInputBinding
A combination of a key and required modifier keys that might trigger a TextInputAction.
TextInputCursorPos
A component containing the current text cursor position.
TextInputCursorTimer
A component that manages the cursor’s blinking.
TextInputInactive
If true, the text input does not respond to keyboard events and the cursor is hidden.
TextInputNavigationBindings
A resource in which key bindings can be specified. Bindings are given as a tuple of (TextInputAction, TextInputBinding).
TextInputPlaceholder
A component containing the placeholder text that is displayed when the text input is empty and not focused.
TextInputPlugin
A Bevy Plugin providing the systems and assets required to make a TextInput work.
TextInputSettings
A component containing the text input’s settings.
TextInputSubmitEvent
An event that is fired when the user presses the enter key.
TextInputSystem
Label for systems that update text inputs.
TextInputTextColor
The Bevy TextColor that will be used when creating the text input’s inner Bevy TextBundle.
TextInputTextFont
The Bevy TextColor that will be used when creating the text input’s inner Bevy TextBundle.
TextInputValue
A component containing the current value of the text input.

Enums§

TextInputAction
Text navigation actions that can be bound via TextInputNavigationBindings.