draw_textmode(string fontname,var mode,var height,var alpha)

Sets the TrueType font, size, attributes, and transparency for draw_text.

Parameters:

fontname the name of the font, or NULL for only setting the transparency. Fonts existing on all Windows machines are "Arial", "Times", and "Courier"
mode 0 = normal, 1 = bold, 2 = italics, 3 = bold + italics
height the height of the font, in points
alpha opacity, 0..100

Remarks:

This is a slow instruction, because the bitmap for the font has to be generated. So don't use it several times during the same frame, except when you only set the transparency for the current font and leave the other parameters at 0.

Speed:

Slow

Example:

  draw_textmode("Times",3,20,0);
var fade = 0;
while(1)
{
draw_textmode(NULL,0,0,fade); // change transparency only
fade = min(100,fade+time_step); // fade in
draw_text("Transparency test!",100,10,vector(255,255,255); // white text
wait(1);
}

See also:

draw_text ► latest version online