Skip to main content

Text

text!

Draws ASCII text.

turbo::canvas
text!(&str, x: i32, y: i32, color: u32, font: Font)
ParamTypeDefaultDescription
-&str-Text to be displayed
xi320Starting x position of the text
yi320Starting y position of the text
coloru320xffffffffHex color to display text in
fontFontFont::MFont to display text in: Font::S, Font::M, or Font::L

Basic Usage

text!("Hello, world!");

Hello, World Screenshot

Advanced Usage

Customized text with specified position, color, and font size:

text!(
"Greetings, earthlings >:3",
x = 30,
y = 40,
color = 0x00ff00ff,
font = Font::S
);

Greetings, Earthlings Screenshot