draw_text_transformed

This function will draw text in a similar way to draw_text() only now you can choose to scale the text along the horizontal or vertical axis (effectively stretching or shrinking it) and also have GameMaker draw it at an angle (where 0 is normal and every degree over 0 rotates the text anti-clockwise).

 

Syntax:

draw_text_transformed(x, y, string, xscale, yscale, angle);

ArgumentTypeDescription
xRealThe x coordinate of the drawn string.
yRealThe y coordinate of the drawn string.
stringStringThe string to draw.
xscaleRealThe horizontal scale (default 1).
yscaleRealThe vertical scale(default 1).
angleRealThe angle of the text.

 

Returns:

N/A

 

Example:

draw_set_halign(fa_center);
draw_set_valign(fa_middle);
image_angle += 1;
draw_text_transformed(room_width / 2, room_height / 2, "GAME OVER!", 2, 2, image_angle);

The above code will draw the given text in the middle of the room, spinning round and scaled to twice its original size.