Fusuma

Components / Components

sprite

Pixel art, one string per row.

Try it

This is the Agent detail page of the gallery, running in your browser: sprite is on it, and it is the real widget. Press Run, then use it.

Live: Agent detail, where sprite is usedOpen full size

Also on this pagedividerkey_value

Pixel art, one string per row.

Each string is a row of the picture and each character a pixel, in a colour of the theme: # the text colour, o primary, i info, s success, w warning, d danger, b the strong border; any other character is clear.

Signature

pub const fn sprite(art: &'static [&'static str]) -> Sprite

Methods

  • .boxed(width: u32, height: u32) -> Self — A box of width x height pixels; the art is drawn as large as fits it, in the middle.

Example

use fusuma::sprite;
static HEART: [&str; 3] = [".d.d.", "ddddd", "..d.."];
let view = sprite(&HEART).boxed(50, 30);
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.nodes(), 1);

All components · Source