Quick answer: GameMaker draw_text_transformed rotated text clipping at view edges? Drawing happens at the top-left anchor — the rotated bounding box can extend beyond the screen even when the anchor is inside.
A spinning UI label flickers off screen edges as it rotates. The view test is checking the anchor; the rotated quad extends past it.
Anchor + Rotation Math
draw_text_transformed(x, y, str, xs, ys, rot) rotates around the top-left of the unrotated text. A 200×30 text rotated 45° reaches further from (x,y) than its size suggests.
Center Pivot
var w = string_width(s) * xs;
var h = string_height(s) * ys;
draw_text_transformed(x - w/2, y - h/2, s, xs, ys, rot);Approximates a center-pivot. For pixel-perfect, draw to a surface and transform the surface.
Surface for Tight Bounds
Render text once to a surface sized to the text bounds, then draw the surface with rotation. The surface has predictable corners.
Verifying
Rotated labels stay fully on screen at all rotation angles.
“draw_text_transformed rotates from top-left. Offset by half-size or use a surface.”
For HUD labels, drawing into a surface once and reusing it is also faster — text layout is the slow part.