draw_get_halign

This function is used to get the text alignment setting along the horizontal axis, and will return one of the constants listed below.

 

Syntax:

draw_get_halign();

 

Returns:

Constant

Horizontal Alignment Constant
ConstantAlignment
fa_leftfa_left example
fa_centerfa_center example
fa_rightfa_right example

 

Example:

var _cur_halign = draw_get_halign();
var _cur_valign = draw_get_valign();

draw_set_halign(fa_right);
draw_set_valign(fa_bottom);

draw_text(100, 32, "Score: " + string(score));

draw_set_halign(_cur_halign);
draw_set_valign(_cur_valign);

The above code saves the currently applied "halign" and "valign" values to local variables, and then changes the alignments to draw some text. After drawing it, it resets the alignments back to the values stored in the local variables.