Skip to content
Open
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
edc879c
Added `input` module to `bevy_text` with systems and components to su…
ickshonpe Jul 30, 2025
f36f9d0
use `is_empty()` instead of checking lengeth is 0
ickshonpe Jul 30, 2025
771477c
Renamings:
ickshonpe Aug 1, 2025
11074c0
Renamed `TextInputPasswordMask` to `PasswordMask`
ickshonpe Aug 1, 2025
f991426
Updated comments including suggestions from review
ickshonpe Aug 1, 2025
62ca2f8
Added a `TextEdit::InsertString` variant. Use to insert a string at …
ickshonpe Aug 1, 2025
308d0c9
Renamed `appy_text_input_action` to `apply_text_edit`
ickshonpe Aug 1, 2025
158f329
Updated `TextInputValue`'s comments to explain that it is synchronise…
ickshonpe Aug 1, 2025
a7d5e45
Expanded the doc comments for `TextInputAttributes`.
ickshonpe Aug 1, 2025
785a1d5
Renamed `TextInputUndoHistory` to `UndoHistory`
ickshonpe Aug 1, 2025
f637123
Merge branch 'main' into bevy-text-input
ickshonpe Aug 1, 2025
b4589b8
Updated buffer's docs and added a `needs_redraw` function.
ickshonpe Aug 1, 2025
8e61105
Updated the doc comments for `apply_text_edits`
ickshonpe Aug 1, 2025
ede9d60
updated another doc comment
ickshonpe Aug 1, 2025
a80a5dc
More doc comments
ickshonpe Aug 1, 2025
0b2c268
Edited the doc comment for apply_text_edits
ickshonpe Aug 1, 2025
93149bc
More comment edits
ickshonpe Aug 1, 2025
049e350
Renamed `Prompt` to `Placeholder` and also updated the comments and t…
ickshonpe Aug 1, 2025
3e9c860
Fixed renaming.
ickshonpe Aug 1, 2025
5c956c6
Rephrased doc comment.
ickshonpe Aug 1, 2025
6396a11
Spellings.
ickshonpe Aug 1, 2025
5d34e6d
Renamed the `InvalidInput` and `ValueChanged` `TextInputEvent` varian…
ickshonpe Aug 1, 2025
57a70cd
Fixed event dispatch.
ickshonpe Aug 1, 2025
85bed33
Added release note
ickshonpe Aug 1, 2025
f43c461
Added migration note for `load_font_to_fontdb` function changes.
ickshonpe Aug 1, 2025
0b6b1d2
Update release note
ickshonpe Aug 1, 2025
897d741
Merge branch 'main' into bevy-text-input
ickshonpe Aug 2, 2025
2bd0216
Update crates/bevy_text/src/input.rs
ickshonpe Aug 2, 2025
255d2c1
Update crates/bevy_text/src/input.rs
ickshonpe Aug 2, 2025
419bcaf
Update crates/bevy_text/src/input.rs
ickshonpe Aug 2, 2025
fe38cf2
Update release-content/release-notes/bevy_text_input_module.md
ickshonpe Aug 2, 2025
dea6616
Update crates/bevy_text/src/input.rs
ickshonpe Aug 2, 2025
48475ff
FIxed comment
ickshonpe Aug 2, 2025
893f9c4
Merge branch 'bevy-text-input' of https://github.com/ickshonpe/bevy i…
ickshonpe Aug 2, 2025
96bacc1
Fix comments
ickshonpe Aug 2, 2025
2035726
Added text input 2d example
ickshonpe Aug 4, 2025
a692fd8
cargo run -p build-templated-pages -- build-example-page
ickshonpe Aug 4, 2025
9371313
Merge branch 'main' into bevy-text-input
alice-i-cecile Aug 5, 2025
27dc3df
Merge branch 'bevy-text-input' of https://github.com/ickshonpe/bevy i…
ickshonpe Aug 5, 2025
622bbe6
Added example skeleton.
ickshonpe Aug 5, 2025
e20e670
Merge branch 'main' into bevy-text-input
ickshonpe Aug 8, 2025
307590a
Added `TextInputStyle` component.
ickshonpe Aug 8, 2025
6611bde
Updated example
ickshonpe Aug 8, 2025
811f0c8
Added `CursorBlinkInterval` resource
ickshonpe Aug 8, 2025
2f43052
Renamed CursorBlinkInterval to TextCursorBlinkInterval.
ickshonpe Aug 8, 2025
acc0706
Added doc comment for resource
ickshonpe Aug 8, 2025
c72f7ce
Deleted style component.
ickshonpe Aug 8, 2025
eb15165
Fixed target size scaling.
ickshonpe Aug 8, 2025
171de2f
Updated comments
ickshonpe Aug 8, 2025
96e3c6e
Clean up
ickshonpe Aug 8, 2025
0ba0b68
Merge branch 'main' into bevy-text-input
ickshonpe Aug 11, 2025
295de7f
Fixed example imports
ickshonpe Aug 11, 2025
6b3f3d8
Anchor output below input in example
ickshonpe Aug 11, 2025
f794658
Removed unnecessary casts
ickshonpe Aug 11, 2025
00a0c13
Fixed wrong casts
ickshonpe Aug 11, 2025
f03a7cf
New `InvalidTextEditError`, returned by `apply_text_edit`.
ickshonpe Aug 11, 2025
fb73aa3
Only collect buffer text if `TextInputValue` is present.
ickshonpe Aug 11, 2025
288ea3b
take just Editor'_> with is_cursor_at_end_of_line
ickshonpe Aug 11, 2025
6817f5c
Added release note suggestion
ickshonpe Aug 11, 2025
7ab3c19
Update crates/bevy_text/src/input.rs
ickshonpe Aug 11, 2025
caa38b1
Drop undo/redo
Zeophlite Aug 19, 2025
d6fb883
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Aug 26, 2025
3146a97
Backticks in docs
Zeophlite Aug 6, 2025
3e1621d
Fix ambiguity_detection
Zeophlite Aug 6, 2025
7f2a1ce
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Aug 26, 2025
ae9b9dc
CI
Zeophlite Aug 26, 2025
430f85e
Apply suggestions from code review
Zeophlite Aug 27, 2025
acaff98
Reposition anchor
Zeophlite Aug 27, 2025
9584a78
Merge remote-tracking branch 'origin/main' into g
Zeophlite Aug 27, 2025
e981c7b
Clarify docs
Zeophlite Aug 27, 2025
60a6349
Feedback
Zeophlite Aug 28, 2025
2f1d6d4
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Aug 28, 2025
1b1bfcc
Lint
Zeophlite Aug 28, 2025
3e14a7d
Copyedits from Vero
alice-i-cecile Aug 28, 2025
9787de6
Fix PR number for font migration guide
alice-i-cecile Aug 28, 2025
91ff4a5
Remove already redundant components when spawning
alice-i-cecile Aug 28, 2025
cb9aa00
Notes from playing around with the example
alice-i-cecile Aug 28, 2025
66048df
Initial module docs
alice-i-cecile Aug 28, 2025
32af1dc
TextInputBuffer config
alice-i-cecile Aug 28, 2025
44a4101
Better docs for `Placeholder`
alice-i-cecile Aug 28, 2025
4089f8a
More breadcrumbs
alice-i-cecile Aug 28, 2025
9a39b80
Docs for `TextEdit`
alice-i-cecile Aug 28, 2025
76b5835
don't need textfont and react to font asset events
mockersf Aug 28, 2025
83956c7
Make cursor blink optional component
Zeophlite Aug 29, 2025
f018a7b
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Aug 29, 2025
4b79c15
Nits
Zeophlite Aug 29, 2025
b9e6198
CI
Zeophlite Aug 29, 2025
053103b
Less magic
Zeophlite Aug 30, 2025
c7e4a0f
Remove TextEdit::Submit
Zeophlite Aug 30, 2025
1c24810
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Aug 30, 2025
e321a9f
reposition -> calculate_bounds
Zeophlite Aug 30, 2025
29b29db
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Sep 2, 2025
9f7b1af
Split bevy_text input.rs into input/
Zeophlite Sep 2, 2025
e49c58f
Merge remote-tracking branch 'origin/main' into no-undo
Zeophlite Sep 2, 2025
0b10def
CI
Zeophlite Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,17 @@ description = "Renders text to multiple windows with different scale factors usi
category = "2D Rendering"
wasm = true

[[example]]
name = "text_input_2d"
path = "examples/2d/text_input_2d.rs"
doc-scrape-examples = true

[package.metadata.example.text_input_2d]
name = "Text Input 2D"
description = "Text input in 2D"
category = "2D Rendering"
wasm = true

[[example]]
name = "texture_atlas"
path = "examples/2d/texture_atlas.rs"
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_sprite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ impl Plugin for SpritePlugin {
bevy_text::detect_text_needs_rerender::<Text2d>,
update_text2d_layout
.after(bevy_camera::CameraUpdateSystems)
.after(bevy_text::remove_dropped_font_atlas_sets),
.after(bevy_text::remove_dropped_font_atlas_sets)
.ambiguous_with(bevy_text::update_placeholder_layouts),
calculate_bounds_text2d.in_set(VisibilitySystems::CalculateBounds),
)
.chain()
Expand Down
8 changes: 8 additions & 0 deletions crates/bevy_sprite/src/sprite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ impl Anchor {
pub fn as_vec(&self) -> Vec2 {
self.0
}

pub fn reposition(&self, size: Vec2) -> (f32, f32, f32, f32) {
let x1 = (Anchor::TOP_LEFT.0.x - self.as_vec().x) * size.x;
let x2 = (Anchor::TOP_LEFT.0.x - self.as_vec().x + 1.) * size.x;
let y1 = (Anchor::TOP_LEFT.0.y - self.as_vec().y - 1.) * size.y;
let y2 = (Anchor::TOP_LEFT.0.y - self.as_vec().y) * size.y;
(x1, x2, y1, y2)
}
}

impl Default for Anchor {
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_text/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ bevy_image = { path = "../bevy_image", version = "0.17.0-dev" }
bevy_log = { path = "../bevy_log", version = "0.17.0-dev" }
bevy_math = { path = "../bevy_math", version = "0.17.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.17.0-dev" }
bevy_time = { path = "../bevy_time", version = "0.17.0-dev" }
bevy_utils = { path = "../bevy_utils", version = "0.17.0-dev" }
bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-features = false, features = [
"std",
Expand Down
Loading
Loading