You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/bevy_text/src/input/buffer.rs
+3-47Lines changed: 3 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,3 @@
1
-
//! This module provides text editing functionality, by wrapping the functionality of the
2
-
//! [`cosmic_text`] crate.
3
-
//!
4
-
//! The primary entry point into the text editing functionality is the [`TextInputBuffer`] component,
5
-
//! which includes a [`cosmic_text::Editor`], and adds the associated "required components" needed
6
-
//! to construct functioning text input fields.
7
-
//!
8
-
//! ## How this works
9
-
//!
10
-
//! Text editing functionality is included as part of [`TextPlugin`](crate::TextPlugin),
11
-
//! and the systems which perform the work are grouped under the [`TextInputSystems`] system set.
12
-
//!
13
-
//! The [`TextInputBuffer`] comes with the following required components that act as machinery to convert user inputs into text:
14
-
//!
15
-
//! * [`TextInputValue`] - Contains the current text in the text input buffer.
16
-
//! * Automatically synchronized with the buffer by [`apply_text_edits`] after any edits are applied.
17
-
//! * [`TextEdits`] - Text input commands queue, used to queue up text edit and navigation actions.\
18
-
//! * Contains a queue of [`TextEdit`] actions that are applied to the buffer.
19
-
//! * These are applied by the [`apply_text_edits` system.
20
-
//! * [`TextInputTarget`] - Details of the render target the text input will be rendered to, such as size and scale factor.
21
-
//!
22
-
//!
23
-
//! Layouting is done in:
24
-
//!
25
-
//! * [`update_text_input_layouts`] - Updates the `TextLayoutInfo` for each text input for rendering.
26
-
//! * [`update_placeholder_layouts`] - Updates the `TextLayoutInfo` for each [`Placeholder`] for rendering.
27
-
//!
28
-
//! ## Configuring text input
29
-
//!
30
-
//! Several components are used to configure the text input, and belong on the [`TextInputBuffer`] entity:
31
-
//!
32
-
//! * [`TextInputAttributes`] - Common text input properties set by the user, such as font, font size, line height, justification, maximum characters etc.
33
-
//! * [`TextInputFilter`] - Optional component that can be added to restrict the text input to certain formats, such as integers, decimals, hexadecimal etc.
34
-
//! * [`PasswordMask`] - Optional component that can be added to hide the text input buffer contents by replacing the characters with a mask character.
35
-
//! * [`Placeholder`] - Optional component that can be added to display placeholder text when the input buffer is empty.
36
-
//! * [`CursorBlink`] - Optional component that controls cursor blinking.
37
-
//!
38
-
//! ## Copy-paste and clipboard support
39
-
//!
40
-
//! The clipboard support provided by this module is very basic, and only works within the `bevy` app,
41
-
//! storing a simple [`String`].
42
-
//!
43
-
//! It can be accessed via the [`Clipboard`] resource.
44
-
45
1
use bevy_asset::{AssetEvent,Assets,Handle};
46
2
use bevy_derive::Deref;
47
3
use bevy_ecs::{
@@ -65,7 +21,7 @@ use crate::{
65
21
/// On changes, the text input systems will automatically update the buffer, layout and fonts as required.
66
22
#[derive(Component,Debug,PartialEq)]
67
23
pubstructTextInputAttributes{
68
-
/// The text input's font, which also applies to any [`Placeholder`] text or password mask.
24
+
/// The text input's font, which also applies to any [`crate::Placeholder`] text or password mask.
69
25
/// A text input's glyphs must all be from the same font.
Copy file name to clipboardExpand all lines: crates/bevy_text/src/input/filtering.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
use bevy_ecs::component::Component;
2
2
3
-
/// If a text input entity has a `TextInputFilter` component, after each [`TextEdit`] is applied, the [`TextInputBuffer`]’s text is checked
4
-
/// against the filter, and if it fails, the `TextEdit` is immediately rolled back, and a [`TextInputEvent::InvalidEdit`] event is emitted.
3
+
/// If a text input entity has a `TextInputFilter` component, after each [`crate::TextEdit`] is applied, the [`crate::TextInputBuffer`]’s text is checked
4
+
/// against the filter, and if it fails, the `TextEdit` is immediately rolled back, and a [`crate::TextInputEvent::InvalidEdit`] event is emitted.
Copy file name to clipboardExpand all lines: crates/bevy_text/src/input/target.rs
-44Lines changed: 0 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,3 @@
1
-
//! This module provides text editing functionality, by wrapping the functionality of the
2
-
//! [`cosmic_text`] crate.
3
-
//!
4
-
//! The primary entry point into the text editing functionality is the [`TextInputBuffer`] component,
5
-
//! which includes a [`cosmic_text::Editor`], and adds the associated "required components" needed
6
-
//! to construct functioning text input fields.
7
-
//!
8
-
//! ## How this works
9
-
//!
10
-
//! Text editing functionality is included as part of [`TextPlugin`](crate::TextPlugin),
11
-
//! and the systems which perform the work are grouped under the [`TextInputSystems`] system set.
12
-
//!
13
-
//! The [`TextInputBuffer`] comes with the following required components that act as machinery to convert user inputs into text:
14
-
//!
15
-
//! * [`TextInputValue`] - Contains the current text in the text input buffer.
16
-
//! * Automatically synchronized with the buffer by [`apply_text_edits`] after any edits are applied.
17
-
//! * [`TextEdits`] - Text input commands queue, used to queue up text edit and navigation actions.\
18
-
//! * Contains a queue of [`TextEdit`] actions that are applied to the buffer.
19
-
//! * These are applied by the [`apply_text_edits` system.
20
-
//! * [`TextInputTarget`] - Details of the render target the text input will be rendered to, such as size and scale factor.
21
-
//!
22
-
//!
23
-
//! Layouting is done in:
24
-
//!
25
-
//! * [`update_text_input_layouts`] - Updates the `TextLayoutInfo` for each text input for rendering.
26
-
//! * [`update_placeholder_layouts`] - Updates the `TextLayoutInfo` for each [`Placeholder`] for rendering.
27
-
//!
28
-
//! ## Configuring text input
29
-
//!
30
-
//! Several components are used to configure the text input, and belong on the [`TextInputBuffer`] entity:
31
-
//!
32
-
//! * [`TextInputAttributes`] - Common text input properties set by the user, such as font, font size, line height, justification, maximum characters etc.
33
-
//! * [`TextInputFilter`] - Optional component that can be added to restrict the text input to certain formats, such as integers, decimals, hexadecimal etc.
34
-
//! * [`PasswordMask`] - Optional component that can be added to hide the text input buffer contents by replacing the characters with a mask character.
35
-
//! * [`Placeholder`] - Optional component that can be added to display placeholder text when the input buffer is empty.
36
-
//! * [`CursorBlink`] - Optional component that controls cursor blinking.
37
-
//!
38
-
//! ## Copy-paste and clipboard support
39
-
//!
40
-
//! The clipboard support provided by this module is very basic, and only works within the `bevy` app,
41
-
//! storing a simple [`String`].
42
-
//!
43
-
//! It can be accessed via the [`Clipboard`] resource.
Copy file name to clipboardExpand all lines: crates/bevy_text/src/input/text_edit.rs
-44Lines changed: 0 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,3 @@
1
-
//! This module provides text editing functionality, by wrapping the functionality of the
2
-
//! [`cosmic_text`] crate.
3
-
//!
4
-
//! The primary entry point into the text editing functionality is the [`TextInputBuffer`] component,
5
-
//! which includes a [`cosmic_text::Editor`], and adds the associated "required components" needed
6
-
//! to construct functioning text input fields.
7
-
//!
8
-
//! ## How this works
9
-
//!
10
-
//! Text editing functionality is included as part of [`TextPlugin`](crate::TextPlugin),
11
-
//! and the systems which perform the work are grouped under the [`TextInputSystems`] system set.
12
-
//!
13
-
//! The [`TextInputBuffer`] comes with the following required components that act as machinery to convert user inputs into text:
14
-
//!
15
-
//! * [`TextInputValue`] - Contains the current text in the text input buffer.
16
-
//! * Automatically synchronized with the buffer by [`apply_text_edits`] after any edits are applied.
17
-
//! * [`TextEdits`] - Text input commands queue, used to queue up text edit and navigation actions.\
18
-
//! * Contains a queue of [`TextEdit`] actions that are applied to the buffer.
19
-
//! * These are applied by the [`apply_text_edits` system.
20
-
//! * [`TextInputTarget`] - Details of the render target the text input will be rendered to, such as size and scale factor.
21
-
//!
22
-
//!
23
-
//! Layouting is done in:
24
-
//!
25
-
//! * [`update_text_input_layouts`] - Updates the `TextLayoutInfo` for each text input for rendering.
26
-
//! * [`update_placeholder_layouts`] - Updates the `TextLayoutInfo` for each [`Placeholder`] for rendering.
27
-
//!
28
-
//! ## Configuring text input
29
-
//!
30
-
//! Several components are used to configure the text input, and belong on the [`TextInputBuffer`] entity:
31
-
//!
32
-
//! * [`TextInputAttributes`] - Common text input properties set by the user, such as font, font size, line height, justification, maximum characters etc.
33
-
//! * [`TextInputFilter`] - Optional component that can be added to restrict the text input to certain formats, such as integers, decimals, hexadecimal etc.
34
-
//! * [`PasswordMask`] - Optional component that can be added to hide the text input buffer contents by replacing the characters with a mask character.
35
-
//! * [`Placeholder`] - Optional component that can be added to display placeholder text when the input buffer is empty.
36
-
//! * [`CursorBlink`] - Optional component that controls cursor blinking.
37
-
//!
38
-
//! ## Copy-paste and clipboard support
39
-
//!
40
-
//! The clipboard support provided by this module is very basic, and only works within the `bevy` app,
41
-
//! storing a simple [`String`].
42
-
//!
43
-
//! It can be accessed via the [`Clipboard`] resource.
0 commit comments