Crate bevy_ratatui_camera

Source
Expand description

Bevy rendered to the terminal!

Structs§

CharactersConfig
Configuration pertaining to character selection, based on criteria determined by the strategy.
ColorsConfig
Configuration pertaining to color selection.
CommonConfig
General configuration not specific to particular strategies.
DepthConfig
Configuration for the RatatuiCameraStrategy::Depth terminal rendering strategy.
HalfBlocksConfig
Configuration for the RatatuiCameraStrategy::HalfBlock terminal rendering strategy.
LuminanceConfig
Configuration for the RatatuiCameraStrategy::Luminance terminal rendering strategy.
RatatuiCamera
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.
RatatuiCameraDepthBuffer
A depth buffer for keeping track of the bevy world-space depth of each character drawn to the terminal buffer, for occluding characters “behind” others with respect to a bevy camera.
RatatuiCameraDepthDetection
When within a camera entity alongside a RatatuiCamera, the depth prepass texture will copied back from the GPU each frame and will be used to update a depth buffer held on the associated RatatuiCameraWidget. This depth buffer can be used to achieve occlusion effects by skipping terminal buffer cell draws based on depth comparisons.
RatatuiCameraEdgeDetection
When spawned with a RatatuiCamera, an edge detection step will run in the render pipeline, and detected edges will be handled differently by each image to unicode character conversion strategy. The edge detection is performed via a sobel filter convolved over the depth, normal, and color textures generated during rendering, resulting in a new texture of detected edges and their directions (horizontal, vertical, both diagonals). Where edges are detected, special characters and optionally an override color can be used.
RatatuiCameraLastArea
Component representing the area that the camera entity’s widget was rendered within last frame. Used internally for triggering resizes, and translating buffer coordinates to bevy coordinates.
RatatuiCameraPlugin
Add this plugin, add a RatatuiCamera component to your camera, and then a RatatuiCameraWidget component will be made available in your camera entity. Use the RatatuiContext provided by bevy_ratatui and this widget to draw the camera’s rendered output to the terminal.
RatatuiCameraSet
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.
RatatuiCameraWidget
Ratatui widget that will be inserted into each RatatuiCamera containing entity and updated each frame with the last image rendered by the camera. When drawn in a ratatui buffer, it will use the RatatuiCamera’s specified RatatuiCameraStrategy to convert the rendered image to unicode characters, and will draw them in the buffer.
RatatuiSubcamera
Bevy relation that allows you to create subcameras that render to a main camera’s render texture instead of creating their own. When RatatuiSubcamera is within into a camera entity (instead of a RatatuiCamera), rather than creating its own render texture for unicode conversion, this camera will render to the texture of the RatatuiCamera main camera entity indicated by the relation. The composite render from both cameras will then be converted to unicode as one image.
RatatuiSubcameras
Bevy relation target for subcameras that will render to this camera entity’s render target.

Enums§

ColorChoice
Options for customizing a terminal buffer color (foreground or background). Customization happens after depth detection and edge detection, and before the conversion for color support and the transparency check.
ColorSupport
Options for restricting the terminal colors that rendered pixels are converted to.
EdgeCharacters
Specify how to handle rendering detected edges as unicode characters.
RatatuiCameraStrategy
Specify the strategy used for converting the camera’s rendered image to unicode characters for the terminal buffer. Insert a variant of this component alongside your RatatuiCamera to change the default behavior.