aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-10 22:14:18 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-10 22:14:18 +0200
commit2a91f0dca320f6be061224cb42ceb31c32a51b6c (patch)
treef6126c8f5fee5ead053bc9ef58e5d5c61b5939cc /include
parentb52ed4028309fd20e3955c5f1a6adce9aa12c87b (diff)
Add mgl_text_set_max_width and mgl_text_set_max_rows
Diffstat (limited to 'include')
-rw-r--r--include/mgl/graphics/text.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mgl/graphics/text.h b/include/mgl/graphics/text.h
index 89ae541..4dd0219 100644
--- a/include/mgl/graphics/text.h
+++ b/include/mgl/graphics/text.h
@@ -23,6 +23,8 @@ typedef struct {
mgl_vec2f position;
mgl_vec2f bounds;
bool bounds_dirty;
+ float max_width;
+ unsigned int max_rows;
} mgl_text;
/*
@@ -41,6 +43,10 @@ void mgl_text_set_string(mgl_text *self, const char *str, size_t str_size);
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);
+/* If |max_width| is 0 then the text has no max width */
+void mgl_text_set_max_width(mgl_text *self, float max_width);
+/* If |max_rows| is 0 then the text can display an unlimited amount of rows */
+void mgl_text_set_max_rows(mgl_text *self, unsigned int max_rows);
mgl_vec2f mgl_text_get_bounds(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);