Trait bevy_capture::CameraTargetHeadless

source ·
pub trait CameraTargetHeadless {
    // Required method
    fn target_headless(
        self,
        width: u32,
        height: u32,
        images: &mut Assets<Image>,
    ) -> Self;
}
Expand description

Extension trait for the camera to set the target to a headless image. This is implemented for Camera, Camera2dBundle, and Camera3dBundle.

§Example

fn setup(mut commands: Commands, mut images: ResMut<Assets<Image>) {
   commands.spawn(Camera2dBundle::default().target_headless(512, 512, &mut images));
}

Required Methods§

source

fn target_headless( self, width: u32, height: u32, images: &mut Assets<Image>, ) -> Self

Sets the target of the camera to a headless image with the given dimensions.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CameraTargetHeadless for Camera2dBundle

source§

fn target_headless( self, width: u32, height: u32, images: &mut Assets<Image>, ) -> Self

source§

impl CameraTargetHeadless for Camera3dBundle

source§

fn target_headless( self, width: u32, height: u32, images: &mut Assets<Image>, ) -> Self

source§

impl CameraTargetHeadless for Camera

source§

fn target_headless( self, width: u32, height: u32, images: &mut Assets<Image>, ) -> Self

Implementors§