nano9 0.1.0-alpha.7

A Pico-8 compatibility layer for Bevy
Documentation
use bevy::prelude::*;
use nano9::prelude::*;
// It's necessary to import Nano-9's `print!` directly to avoid ambiguity with
// `print!` in std.
use nano9::prelude::print;

fn draw(mut pico8: Pico8) -> Result<(), BevyError> {
    cls!(pico8)?;
    let t = pico8.time();
    let size = (t / 3.0 % 10.0 + 4.0).floor();
    let font = (t % 2.0) as usize;
    print!(pico8, "hello world", _, _, Some(size), Some(font))?;

    print!(
        pico8,
        format!("font {} size {:.1} ", &font, &size),
        Vec2::new(0.0, 20.0),
        PColor::Palette(12)
    )?;
    Ok(())
}

fn main() {
    let mut app = App::new();
    app.add_systems(nano9::schedule::Draw, draw);

    app.add_plugins(Nano9Plugins::default())
        .add_systems(Startup, load_and_insert_pico8("hello-font.toml"))
        .add_systems(PreUpdate, run_pico8_when_loaded)
        .add_systems(
            Update,
            nano9::action::toggle_pause.run_if(nano9::condition::on_just_pressed(KeyCode::KeyP)),
        );
    #[cfg(feature = "minibuffer")]
    app.add_plugins(nano9::minibuffer::quick_plugin);
    #[cfg(feature = "debugdump")]
    bevy_mod_debugdump::print_schedule_graph(&mut app, Update);
    app.run();
}