diff --git a/hui/src/element/builtin/text.rs b/hui/src/element/builtin/text.rs index ffb00b1..3e760ff 100644 --- a/hui/src/element/builtin/text.rs +++ b/hui/src/element/builtin/text.rs @@ -57,6 +57,13 @@ impl Default for Text { } impl Text { + pub fn new(text: impl Into>) -> Self { + Self { + text: text.into(), + ..Default::default() + } + } + fn font(&self, f: FontHandle) -> FontHandle { self.font.unwrap_or(f) }