Function console_utils::reveal

source ·
pub fn reveal(time_between: f64, str: &str, new_line: bool)
Expand description

Reveal Function

Displays a string gradually, revealing one character at a time with a specified time interval between each character.

Arguments

  • time_between - The time interval (in seconds) between each revealed character.
  • str - The string to reveal gradually.
  • new_line - If true, adds a newline character after the revelation.

Example

use console_utils::reveal;

// Display "Hello World!" with a time interval of 0.1 seconds between each character and a new line after it's finished.
reveal(0.1, "Hello World!", true);