{"id":15137897,"url":"https://github.com/dothanhtrung/bevy-text-edit","last_synced_at":"2025-10-16T12:56:25.753Z","repository":{"id":243696537,"uuid":"813168704","full_name":"dothanhtrung/bevy-text-edit","owner":"dothanhtrung","description":"Bevy plugin for easier input text","archived":false,"fork":false,"pushed_at":"2025-01-17T10:00:17.000Z","size":68,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T18:48:23.306Z","etag":null,"topics":["bevy","bevy-plugin","game-development","rust"],"latest_commit_sha":null,"homepage":"https://gitlab.com/kimtinh/bevy-text-edit","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dothanhtrung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"kimtinh","liberapay":"kimtinh"}},"created_at":"2024-06-10T15:43:24.000Z","updated_at":"2025-01-17T10:00:19.000Z","dependencies_parsed_at":"2024-06-26T14:25:15.964Z","dependency_job_id":"2cd4418f-6272-469f-a09e-aecf5aa9fcdd","html_url":"https://github.com/dothanhtrung/bevy-text-edit","commit_stats":{"total_commits":48,"total_committers":1,"mean_commits":48.0,"dds":0.0,"last_synced_commit":"e0ebb06a9dd890309f0cf72ae7546f203a3fdc53"},"previous_names":["dothanhtrung/bevy-text-edit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dothanhtrung%2Fbevy-text-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dothanhtrung%2Fbevy-text-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dothanhtrung%2Fbevy-text-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dothanhtrung%2Fbevy-text-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dothanhtrung","download_url":"https://codeload.github.com/dothanhtrung/bevy-text-edit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237834657,"owners_count":19373764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","bevy-plugin","game-development","rust"],"created_at":"2024-09-26T07:03:27.224Z","updated_at":"2025-10-16T12:56:25.735Z","avatar_url":"https://github.com/dothanhtrung.png","language":"Rust","funding_links":["https://ko-fi.com/kimtinh","https://liberapay.com/kimtinh"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\nbevy_text_edit\n==============\n\n[![crates.io](https://img.shields.io/crates/v/bevy_text_edit)](https://crates.io/crates/bevy_text_edit)\n[![docs.rs](https://docs.rs/bevy_text_edit/badge.svg)](https://docs.rs/bevy_text_edit)\n[![dependency status](https://deps.rs/repo/gitlab/kimtinh/bevy-text-edit/status.svg)](https://deps.rs/repo/gitlab/kimtinh/bevy-text-edit)\n[![pipeline status](https://gitlab.com/kimtinh/bevy-text-edit/badges/master/pipeline.svg)](https://gitlab.com/kimtinh/bevy-text-edit/-/commits/master)\n\n[![Gitlab](https://img.shields.io/badge/gitlab-%23181717.svg?style=for-the-badge\u0026logo=gitlab\u0026logoColor=white)](https://gitlab.com/kimtinh/bevy-text-edit)\n[![Github](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/dothanhtrung/bevy-text-edit)\n\n![](screenshots/text_edit.gif)\n\n![](screenshots/virtual_keyboard.png)\n\n\u003c/div\u003e\n\nA very easy-to-use plugin for input text in Bevy. Good enough for game setting and command console.\n\nFeatures:\n* [x] Switchable between multiple text boxes.\n* [x] Moving the text cursor using arrow keys and Home/End.\n* [x] Limit input length.\n* [x] Filter input text with regex.\n* [x] Placeholder.\n* [x] Paste with `Ctrl+v`.\n* [x] In-game virtual keyboard.\n  * [x] Repeated key.\n\nNot support:\n* [ ] IME.\n* In-game virtual keyboard.\n  * [ ] Multi-language.\n* [ ] Select text.\n* [ ] Copy.\n\n\nQuickstart\n----------\n\n### Plugin\n\nAdd plugin `TextEditPlugin` to the app and define which states it will run in:\n\n```rust\n#[derive(Clone, Debug, Default, Eq, PartialEq, Hash, States)]\nenum GameState {\n    #[default]\n    Menu,\n}\n\nfn main() {\n    App::new()\n        .add_plugins(DefaultPlugins)\n        // Add the plugin\n        .add_plugins(TextEditPlugin::new(vec![GameState::Menu]))\n        .run;\n}\n```\n\nIf you don't care to game state and want to always run input text, use `TextEditPluginAnyState`:\n\n```rust\nfn main() {\n    App::new()\n        .add_plugins(DefaultPlugins)\n        // Add the plugin\n        .add_plugins(TextEditPluginAnyState::any())\n        .add_systems(Startup, setup)\n        .run();\n}\n```\n\n### Component\n\nInsert component `TextEditable` into any text entity that needs to be editable:\n\n```rust\nfn setup(mut commands: Commands) {\n    commands.spawn((\n        TextEditable::default(), // Mark text is editable\n        Text::new(\"Input Text 1\"),\n    ));\n}\n```\n\nOnly text focused by clicking gets keyboard input.\n\nIt is also possible to limit which characters are allowed to enter through `filter_in` and `filter_out` attribute\n(regex is supported):\n\n```rust\nfn setup(mut commands: Commands) {\n    commands.spawn((\n        TextEditable {\n            filter_in: vec![\"[0-9]\".into(), \" \".into()], // Only allow number and space\n            filter_out: vec![\"5\".into()],                // Ignore number 5\n            ..default()\n        },\n        Text::new(\"Input Text 1\"),\n    ));\n}\n```\n\n### Get text\n\nThe edited text can be retrieved from event or observe trigger `TextEdited`.\n\n```rust\n// Get by event\nfn get_text(\n    mut event: MessageReader\u003cTextEdited\u003e,\n) {\n    for e in event.read() {\n        info!(\"Entity {}: {}\", e.entity, e.text);\n    }\n}\n```\n\n```rust\n// Get by observing\nfn setup(mut commands: Commands) {\n    commands.spawn((\n        TextEditable::default(),\n        Text::new(\"Input Text\"),\n    )).observe(get_text);\n}\n\nfn get_text(\n    trigger: On\u003cTextEdited\u003e,\n) {\n    let text = trigger.text.as_str();\n    info!(\"{}\", text);\n}\n\n```\n\nLicense\n-------\n\nPlease see [LICENSE](./LICENSE).\n\n\nCompatible Bevy Versions\n------------------------\n\n| bevy | bevy_text_edit |\n|------|----------------|\n| 0.17 | 0.7            |\n| 0.16 | 0.6            |\n| 0.15 | 0.4-0.5        |\n| 0.14 | 0.1-0.3        |\n| 0.13 | 0.0.1-0.0.5    |\n\n---------\n\n\u003cdiv align=\"center\"\u003e\n\n![git_bevy-text-edit](https://count.getloli.com/@git_bevy-text-edit?name=git_bevy-text-edit\u0026theme=random\u0026padding=10\u0026offset=0\u0026align=top\u0026scale=1\u0026pixelated=1\u0026darkmode=auto)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdothanhtrung%2Fbevy-text-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdothanhtrung%2Fbevy-text-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdothanhtrung%2Fbevy-text-edit/lists"}