draw_text_transformed_colour


描述

This function is a combination of the base draw_text function with the draw_text_transformed and draw_text_colour functions, permitting you to scale and rotate text as well as colour it with a gradient fill and change its alpha value, ignoring the base alpha and colour settings for drawing.

NOTE: Gradient blending is not available for the HTML5 target unless WebGL is enabled, although you can still set the blending colours and it will blend the font with the first given colour. However all blending in this way creates a duplicate font which is then stored in the cache and used when required, which is far from optimal and if you use multiple colour changes it will slow down your games performance. You can set the font cache size to try and limit this should it be necessary using the function font_set_cache_size.


语法:

draw_text_transformed_colour(x, y, string, xscale, yscale, angle, c1, c2, c3, c4, alpha);

参数 描述
x The x coordinate of the drawn string.
y The y coordinate of the drawn string.
string The string to draw.
x轴缩放 The horizontal scale.
y轴缩放 The vertical scale.
角度 The angle of the text.
c1 The colour for the top left of the drawn text.
c2 The colour for the top right of the drawn text.
c3 The colour for the bottom right of the drawn text.
c4 The colour for the bottom left of the drawn text.
alpha The alpha for the text.


返回:

N/A(无返回值)


例如:

draw_set_halign(fa_center);
draw_set_valign(fa_middle);
image_angle += 1;
draw_text_transformed_colour(room_width / 2, room_height / 2, keyboard_string, 2, 2, image_angle, c_red, c_red, c_yellow, c_yellow, 0.5);

The above code will draw the given text in the middle of the room, spinning round and scaled to twice its original size, with a colour gradient going from yellow to red as well as an alpha of 0.5.