The chirp file format

| ❗ A syntax overall is expected in 0.10.0!!! Beware ❗ | |------------------------------------------------------------|

The .chirp file format is a general bevy scene text file format. It was designed to look as close as possible to the [dsl!] macro from cuicui_dsl.

It just so happen that all cuicui crates are compatible with .chirp files.

It is a custom file format. The parser is written using winnow and directly interprets the bits.

It provides a bevy Plugin to load .chirp files with the AssetServer as scenes.

Usage

First, write the chirp file:

ron // file: <scene.chirp> // Use screen_root to follow the screen's boundaries row(screen_root) { row(margin 9, border(5, cyan), bg navy) { spawn(text "Hello world!"); } } Second, add the plugin and load the chirp file: ```rust,norun use bevy::prelude::*; use cuicuidsl::BaseDsl; use cuicui_chirp::Chirp;

fn main() { // Do not forget to add cuicuilayoutbevy{ui,sprite}::Plugin // and cuicuichirp::loader::Plugin with the wanted DSL as type parameter App::new().addplugins(( DefaultPlugins, cuicuichirp::loader::Plugin::new::(), )) .add_systems(Startup, setup) .run(); } fn setup(mut commands: Commands, assets: Res) { // commands.spawn((Camera2dBundle::default(), LayoutRootCamera)); // Spawn the chirp scene as is. Yeah that's it. commands.spawn(assets.load::("scene.chirp")); } ```

See the cuicui_layout repository root README for more details.

Differences with the dsl! macro

Both crates are not mutually exclusive. You can prototype with a .chirp file, then copy the chirp content into a dsl! macro. This is how the chirpunk example was built.

Features