Home > Community Toolbox Reference > Drawing utilities > Settings
Sets the horizontal and vertical alignment of the drawn text.
Argument | Type | Usage | Description |
---|---|---|---|
halign | Constant.HAlign |
Required | The horizontal alignment to set. |
valign | Constant.VAlign |
Required | The vertical alignment to set. |
N/A
The following code draws text in the middle of a button.
draw_self();
draw_set_color_alpha(c_yellow, 1);
draw_set_align(fa_center, fa_middle);
draw_set_font(fnt_Button);
draw_text(x + sprite_width div 2, y + sprite_height div 2, "Click me!");
// reset the color
draw_set_color_alpha(c_white, 1);
- 24.6.0 - Created a function to set horizontal and vertical text align at once.