1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
use *;
use crateRatatuiCameraStrategy;
/// Spawn this component with your bevy camera in order to send each frame's rendered image to
/// a RatatuiCameraWidget that will be inserted into the same camera entity.
///
/// Example:
///
/// ```no_run
/// # use bevy::prelude::*;
/// # use bevy_ratatui_camera::RatatuiCamera;
/// #
/// # fn setup_scene_system(mut commands: Commands) {
/// commands.spawn((
/// RatatuiCamera::default(),
/// Camera3d::default(),
/// ));
/// # };
/// ```
///
/// When inserted into a camera entity, rather than creating its own render texture for unicode
/// conversion, this camera will render to the texture of the RatatuiCamera camera entity indicated
/// by the provided entity id. The composite render from both cameras will then be converted to
/// unicode as one image.
///
/// Example:
///
/// ```no_run
/// # use bevy::prelude::*;
/// # use bevy_ratatui_camera::{RatatuiCamera, RatatuiSubcamera};
/// #
/// # fn setup_scene_system(mut commands: Commands) {
/// let main_camera = commands.spawn((
/// RatatuiCamera::default(),
/// Camera3d::default(),
/// )).id();
///
/// commands.spawn((
/// RatatuiSubcamera(main_camera),
/// Camera3d::default(),
/// ));
/// # };
/// ```
///
// TODO: When bevy 0.16 arrives, use new relations feature.
// #[relationship(relationship_target = RatatuiCameraTargetedBy)]
;
// TODO: When bevy 0.16 arrives, use new relations feature.
// /// All camera entities that are rendering to this camera entity's render target.
// #[derive(Component, Debug)]
// #[relationship_target(relationship = RatatuiCameraTargeting)]
// struct RatatuiCameraTargetedBy(Vec<Entity>);
/// System set for the systems that perform this crate's functionality. Because important pieces of
/// this crate's functionality are provided by components that are not added by the user directly,
/// but are inserted and updated by this crate's observers and event handlers (e.g.
/// RatatuiCameraWidget), it is important to order your systems relative to this system set to make
/// sure certain components are present and up-to-date.
///
/// System set that runs in the [First] schedule, for the systems that create the
/// RatatuiCameraWidget components each frame, retrieve rendered images from the GPU, and keep the
/// mechanisms for performing that retrieval up-to-date (e.g. after resizes).
;