Function print_fmt

Source
pub fn print_fmt(args: Arguments<'_>)
Expand description

Prints a formatted string to the in-game console (Skyrim).

This function takes a fmt::Arguments object and formats it as a string, then passes it to the native ConsoleLog::print function.

§Examples

use commonlibsse_ng::re::ConsoleLog::print_fmt;
print_fmt(format_args!("Health: {}", 100));

§Notes

  • This function allocates on the heap due to CString::new.
  • If the input string contains null bytes (\0), it will return early and not print anything.
  • This is intended for internal use by console_print! and console_println! macros.

§Safety

Internally uses a mutable reference to the singleton Console, accessed via unsafe.