diff --git a/agb/examples/text_render.rs b/agb/examples/text_render.rs index d621e3ea..2f4b26e8 100644 --- a/agb/examples/text_render.rs +++ b/agb/examples/text_render.rs @@ -36,8 +36,7 @@ fn main(mut gba: agb::Gba) -> ! { vram.remove_dynamic_tile(background_tile); FONT.render_text( - 0, - 3, + (0u16, 3u16).into(), "Hello, World!\nThis is a font rendering example", 1, 2, diff --git a/agb/examples/unscii-8.ttf b/agb/examples/unscii-8.ttf deleted file mode 100644 index 7fe801ee..00000000 Binary files a/agb/examples/unscii-8.ttf and /dev/null differ diff --git a/agb/src/display/font.rs b/agb/src/display/font.rs index 1fe077f9..8b735f08 100644 --- a/agb/src/display/font.rs +++ b/agb/src/display/font.rs @@ -1,3 +1,4 @@ +use crate::fixnum::Vector2D; use crate::hash_map::HashMap; use super::tiled::{RegularMap, TileSetting, VRamManager}; @@ -54,8 +55,7 @@ impl Font { impl Font { pub fn render_text( &self, - tile_x: u16, - tile_y: u16, + tile_pos: Vector2D, text: &str, foreground_colour: u8, background_colour: u8, @@ -115,7 +115,7 @@ impl Font { for ((x, y), tile) in tiles.into_iter() { bg.set_tile( vram_manager, - (tile_x + x as u16, tile_y + y as u16).into(), + (tile_pos.x + x as u16, tile_pos.y + y as u16).into(), &tile.tile_set(), TileSetting::from_raw(tile.tile_index()), );