bevy_webcam 0.2.0

bevy webcam plugin
Documentation

bevy_webcam 📷

GitHub License crates.io

bevy camera input, using the nokhwa crate

usage

app.add_plugins((
    DefaultPlugins,
    BevyWebcamPlugin::default(),
));
app.add_systems(
    Update,
    setup_ui,
);

// ...

fn setup_ui(
    mut commands: Commands,
    stream: Res<WebcamStream>,
) {
    commands.spawn(Camera2d);

    commands.spawn((
        ImageNode {
            image: stream.frame.clone(),
            ..default()
        },
        Node {
            width: Val::Percent(100.0),
            height: Val::Percent(100.0),
            ..default()
        },
    ));
}

features

  • native camera
  • threaded camera
  • wasm camera