From cb3ed21d9891a67f477b3bd62fa9be706941295f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 10 Sep 2024 22:18:18 +0200 Subject: Add Text::set_max_width and Text::set_max_rows --- src/graphics/Text.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/graphics/Text.cpp') diff --git a/src/graphics/Text.cpp b/src/graphics/Text.cpp index a30cdf3..e138a28 100644 --- a/src/graphics/Text.cpp +++ b/src/graphics/Text.cpp @@ -47,12 +47,20 @@ namespace mgl { mgl_text_set_position(&text, {position.x, position.y}); } + vec2f Text::get_position() const { + return { text.position.x, text.position.y }; + } + void Text::set_color(Color color) { mgl_text_set_color(&text, {color.r, color.g, color.b, color.a}); } - vec2f Text::get_position() const { - return { text.position.x, text.position.y }; + void Text::set_max_width(float max_width) { + mgl_text_set_max_width(&text, max_width); + } + + void Text::set_max_rows(unsigned int max_rows) { + mgl_text_set_max_rows(&text, max_rows); } FloatRect Text::get_bounds() { -- cgit v1.2.3