Fix the text_render example

This commit is contained in:
Gwilym Kuiper 2022-11-21 07:28:40 +00:00
parent 707c2bf7e7
commit 9660b6df12

View file

@ -40,7 +40,8 @@ fn main(mut gba: agb::Gba) -> ! {
vram.remove_dynamic_tile(background_tile); vram.remove_dynamic_tile(background_tile);
let mut writer = FONT.render_text((0u16, 3u16).into(), 1, 2, &mut bg, &mut vram); let mut renderer = FONT.render_text((0u16, 3u16).into());
let mut writer = renderer.writer(1, 2, &mut bg, &mut vram);
writeln!(&mut writer, "Hello, World!").unwrap(); writeln!(&mut writer, "Hello, World!").unwrap();
writeln!(&mut writer, "This is a font rendering example").unwrap(); writeln!(&mut writer, "This is a font rendering example").unwrap();
@ -53,7 +54,8 @@ fn main(mut gba: agb::Gba) -> ! {
let mut frame = 0; let mut frame = 0;
loop { loop {
let mut writer = FONT.render_text((4u16, 0u16).into(), 1, 2, &mut bg, &mut vram); let mut renderer = FONT.render_text((4u16, 0u16).into());
let mut writer = renderer.writer(1, 2, &mut bg, &mut vram);
writeln!(&mut writer, "Frame {}", frame).unwrap(); writeln!(&mut writer, "Frame {}", frame).unwrap();
writer.commit(); writer.commit();