draw_text


描述

With this function you can draw any string at any position within the room (for drawing real numbers you should use the string function to convert them into text). To combine strings you can use + (see example below) and you can also use \n within a string to add a line break so it is drawn over multiple lines (for information on how to properly format a string and what escape characters you can use, please see here). The colour of the text and the alpha are governed by the current base alpha and colour values as set by draw_set_alpha and draw_set_colour.

NOTE: The actual position of the text will be influenced by the alignment values set by draw_set_halign and draw_set_valign.


语法:

draw_text(x, y, string);

参数 描述
x The x coordinate of the drawn string.
y The y coordinate of the drawn string.
string The string to draw.


返回:

N/A(无返回值)


例如:

draw_text(x, y, "Hello, " + global.Name + "!\nI hope you are well!");

The above code will draw a string at the instance x/y position, which will use the string stored in the global variable "Name" and split it over two lines.