aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-10 22:18:18 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-10 22:18:18 +0200
commitcb3ed21d9891a67f477b3bd62fa9be706941295f (patch)
treeb3e5d1b2cc33a73db3847cd70d182216d750bab1 /src/graphics
parente16c6ed3dad61ad9b25344d5133c2223da422f6e (diff)
Add Text::set_max_width and Text::set_max_rows
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Text.cpp12
1 files changed, 10 insertions, 2 deletions
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() {