ratatui-ratty 0.1.0

A Ratatui widget for rendering inline 3D graphics via Ratty Graphics Protocol
Documentation

ratatui-ratty 🐀

A ratatui widget for placing inline 3D objects in Ratty through the Ratty Graphics Protocol.

Example

use std::io;

use ratatui_core::{buffer::Buffer, layout::Rect, widgets::Widget};
use ratatui_ratty::{RattyGraphic, RattyGraphicSettings};

fn main() -> io::Result<()> {

    let graphic = RattyGraphic::new(
        RattyGraphicSettings::new("assets/objects/SpinyMouse.glb")
            .id(7)
            .animate(true)
            .scale(1.0),
    );
    graphic.register()?;

    let mut buf = Buffer::empty(Rect::new(0, 0, 80, 24));
    (&graphic).render(Rect::new(10, 5, 24, 10), &mut buf);

    Ok(())
}

The widget emits RGP APC sequences into the target buffer cell. Ratty then resolves the asset and renders it as an inline 3D object anchored to that terminal region.

Examples

License

Licensed under The MIT License.