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 Studio 2 draw it at an angle (where 0 is normal and every degree over 0 rotates the text anti-clockwise).
draw_text_transformed(x, y, string, xscale, yscale, angle);
参数 | 描述 |
---|---|
x | The x coordinate of the drawn string. |
y | The y coordinate of the drawn string. |
string | The string to draw. |
x轴缩放 | The horizontal scale (default 1). |
y轴缩放 | The vertical scale(default 1). |
角度 | The angle of the text. |
N/A(无返回值)
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.