Quick answer: The w parameter is in unscaled pixels. If you draw scaled (via draw_text_ext_transformed), divide your target width by the scale. -1 means no wrapping.
A dialogue box uses draw_text_ext with width 400 but text overflows. The draw is scaled 2×, so 400 unscaled = 800 on screen — wider than the box.
Scaled Draw Math
var box_width = 400; // on-screen pixels
var text_scale = 2;
var wrap_w = box_width / text_scale; // 200 unscaled
draw_text_ext_transformed(x, y, message, -1, wrap_w, text_scale, text_scale, 0);
draw_text_ext_transformed’s width is applied before scaling. Divide by scale so the wrapped result fits the on-screen box.
Line Height (sep)
The sep argument (-1 = default) is also unscaled. For scaled text, pass an explicit unscaled line height if the default looks too tight or loose.
-1 Means No Wrap
Passing w = -1 disables wrapping entirely — the text draws on one line. If your text isn’t wrapping at all, check you didn’t pass -1.
Font Matters
Wrapping breaks on spaces. A font without proper space-width metrics, or a string with no spaces (a long URL), won’t wrap. Insert soft break points for unbreakable strings.
Verifying
Dialogue text wraps inside the box at any scale. Multi-line strings respect line height. Long words break or overflow predictably.
“draw_text_ext width is unscaled. Divide by your draw scale and it wraps where you expect.”
For localization, test wrapping with German and Finnish strings — they’re ~30% longer than English and expose box-sizing bugs fast.