Crates.io | bevy_wry |
lib.rs | bevy_wry |
version | 0.1.6 |
source | src |
created_at | 2024-01-25 10:58:44.558132 |
updated_at | 2024-02-23 19:12:17.126185 |
description | A tauri-apps/wry integration with Bevy engine |
homepage | |
repository | https://github.com/PawelBis/bevy_wry |
max_upload_size | |
id | 1113682 |
size | 125,498 |
'bevy_wry' is a bevy plugin that provides integration with wry - cross platform webview rendering library written in rust.
'bevy_wry' enables bevy::Event based communication with WebView through websocket.
It is still in very early stages, however I think it is good enough for some experimentation.
Each client is simply reading/writing to websocket in a thread through MessageBus
. The 'websocket.read()' call is non blocking - current version is relying on TcpStream::set_non_clocking(true)
, however this will be improved in the future, as current implementation is quite expensive.
You can read events incoming from websocket with EventReader<InEvent<T>>
and write events with EventWriter<OutEvent<T>>
.
Check the simple example for a quick reference.
cargo run --example simple --features="bincode bevy/bevy_core_pipeline bevy/bevy_render bevy/bevy_sprite"
bincode
- default bincode SerializeMessage
and DeserializeMessage
for types that implement/derive serde::Serialize
and serde::Deserialize
.