Expand description

snailshell

Tiny library for making terminal text display with pleasant RPG-style animations.

Examples

// basic
snailprint("MUDKIP used WATER GUN!");

// custom speeds
snailprint_d("This fully prints in exactly one second.", 1.0);
snailprint_s("This prints six characters per second", 6.0);

Colored Text

use snailshell::*;

// use any library you like.
// Snailshell works on any type that implements display.
// That means any type which you can use print!(), println!(), or format!() with!
use crossterm::style::Stylize;

snailprint("flamingo, oh oh ou-oh".magenta());

Refresh Rate

You can change the refresh rate with set_snail_fps. This is entirely optional.

Default fps is 60.

Functions

Sets the global fps of animated text.

Animate text with a fixed duration of two seconds.

Animate text with custom fixed duration. If you are printing a message with 10 characters and a one with 200, they will both take the same amount of time if passed the same duration.

Animate text at a constant speed of chars per second. This will animate so that each character printed takes a predictable speed, unlike snailprint_d.