macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

add measure_multiline_text

Open JaniM opened this issue 11 months ago • 2 comments

Expands on top of https://github.com/not-fl3/macroquad/pull/883, that should be merged first. This PR only adds the latest commit so review should focus on that.

This change adds a new function, measure_multiline_text and updates draw_multiline_text to return the dimensions. I expanded the text_wrap example to show its results.

Should solve https://github.com/not-fl3/macroquad/issues/870.

JaniM avatar Jan 13 '25 10:01 JaniM

Are there any issues blocking this PR? (I'd be happy to fix them)

I've come across the exact same situation: draw_text has its measure_text counterpart, but draw_multiline_text does not have measure_multiline_text (and it doesn't return the dimensions, like measure_text does).

(It could be implementable by the user, I think, but the font attribute in Font is private so, the font's vertical spacing is inaccessible afaict)

amatgil avatar Aug 24 '25 16:08 amatgil

@amatgil could you please rebase it? I'll merge it right away

not-fl3 avatar Aug 25 '25 13:08 not-fl3