From 143406591aec45bf6eae930ffa49b5636550bcbf Mon Sep 17 00:00:00 2001 From: Corwin Date: Fri, 8 Mar 2024 22:23:45 +0000 Subject: [PATCH] add convenience to font render --- agb/src/display/object/font.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agb/src/display/object/font.rs b/agb/src/display/object/font.rs index b6efbeb01..a17601b05 100644 --- a/agb/src/display/object/font.rs +++ b/agb/src/display/object/font.rs @@ -481,6 +481,14 @@ impl ObjectTextRender<'_> { false } + /// Immediately renders all the completed letter groups in the buffer. + pub fn render_all(&mut self) { + while !self.buffer.buffered_chars.is_empty() { + self.buffer.process(); + } + self.number_of_objects = self.buffer.letters.letters.len(); + } + fn at_least_n_letter_groups(&mut self, n: usize) { while !self.buffer.buffered_chars.is_empty() && self.buffer.letters.letters.len() <= n { self.buffer.process();