Macro godot_str
macro_rules! godot_str {
($fmt:literal $(, $args:expr)* $(,)?) => { ... };
}
Expand description
Concatenates format-style arguments into a GString
.
Works similar to Rust’s standard format!
macro but returns a Godot GString
.
§Example
use godot::builtin::GString;
use godot::global::godot_str;
let name = "Player";
let score = 100;
let message: GString = godot_str!("The {name} scored {score} points!");
§See also
This macro uses the underlying global::str()
function, which takes a variable-length slice of variants.
Godot equivalent: @GlobalScope.str()
.