From dcc00b359e313166f7f155bddc5cebc336c744b7 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 16 Nov 2021 02:19:46 +0100 Subject: Text: add function to get character position by index, use same character loop everywhere --- include/mgl/graphics/text.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/mgl/graphics/text.h b/include/mgl/graphics/text.h index a645b0b..08a6c37 100644 --- a/include/mgl/graphics/text.h +++ b/include/mgl/graphics/text.h @@ -41,6 +41,8 @@ void mgl_text_set_font(mgl_text *self, mgl_font *font); void mgl_text_set_position(mgl_text *self, mgl_vec2f position); void mgl_text_set_color(mgl_text *self, mgl_color color); mgl_vec2f mgl_text_get_bounds(const mgl_text *self); +/* Returns the position of the character on the screen (relative to the current mgl_view) */ +mgl_vec2f mgl_text_find_character_pos(mgl_text *self, size_t index); void mgl_text_draw(mgl_context *context, mgl_text *text); #endif /* MGL_TEXT_H */ -- cgit v1.2.3