draw_text

Draw a string at a given position.

Syntax:

draw_text(x, y, string);


Argument Description
x The x coordinate of the drawn string.
y The y coordinate of the drawn string.
string The string to draw.


Returns: N/A


Description

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), you can also use # to add a line break to the string (should you need to display the # symbol, then you should precede it with a backslash like this "this will draw a \#") and you can also draw quotations by using inverted commas (for example 'I said "Hello"...'). 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.


Example:

draw_text(x, y, "Hello, " + global.Name + "!#I 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.


Back: Drawing Text
Next: draw_text_ext
© Copyright YoYo Games Ltd. 2018 All Rights Reserved