#bevy #wry #bevy-plugin #cross-platform

bevy_wry

A tauri-apps/wry integration with Bevy engine

7 releases

0.1.6 Feb 23, 2024
0.1.5 Feb 22, 2024
0.1.0 Jan 25, 2024
0.0.1 Feb 18, 2024

#696 in GUI

Download history 364/week @ 2024-02-15 228/week @ 2024-02-22 8/week @ 2024-02-29 6/week @ 2024-03-07 43/week @ 2024-03-28 20/week @ 2024-04-04

63 downloads per month

MIT license

34KB
397 lines

About

'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>>.

Example

Check the simple example for a quick reference. cargo run --example simple --features="bincode bevy/bevy_core_pipeline bevy/bevy_render bevy/bevy_sprite"

Features

  • bincode - default bincode SerializeMessage and DeserializeMessage for types that implement/derive serde::Serialize and serde::Deserialize.

Dependencies

~21–67MB
~1M SLoC