Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

draw_text_outline()

Xubiod edited this page Nov 14, 2017 · 1 revision

Draws text with an outline

Syntax

draw_text_outline(x, y, text, outline width, text color, border color)

Argument Description
x The x position of the text.
y The y position of text.
outline width The width of the outline.
text color The color of the text.
border color The color of the outline.

Returns: Nothing


Description

This function draws text to the window or surface with an outline with a specific outline width and color.


Example:

draw_text_outline(4,4, "Health: " + string(health), 4, c_white, c_black);

Draws the built-in health variable 4 pixels from the left and top with an outline width of 4 pixels.


GML Equivalent:

You can not use the function by doing this:

_draw_x = 4;
_draw_y = 4;
_width = 4;
_string = "Health: " + string(health);

draw_set_colour(c_black);

draw_text(_draw_x-_width,_draw_y-_width,_string);
draw_text(_draw_x       ,_draw_y-_width,_string);
draw_text(_draw_x+_width,_draw_y-_width,_string);

draw_text(_draw_x-_width,_draw_y       ,_string);
draw_text(_draw_x       ,_draw_y       ,_string);
draw_text(_draw_x+_width,_draw_y       ,_string);

draw_text(_draw_x-_width,_draw_y+_width,_string);
draw_text(_draw_x       ,_draw_y+_width,_string);
draw_text(_draw_x+_width,_draw_y+_width,_string);

draw_set_colour(c_white);
draw_text(_draw_x       ,_draw_y       ,_string);