For text drawing the following functions exist:
draw_set_font(font) Sets the font that will be used when drawing text. Use -1 to set the default font (Arial 12).
draw_set_halign(halign) Sets the horizontal alignment used when drawing text. Choose one of the following constants as values:fa_left
fa_center
fa_rightdraw_set_valign(valign) Sets the vertical alignment used when drawing text. Choose one of the following constants as values:
fa_top
fa_middle
fa_bottomdraw_text(x,y,string) Draws the string at position (x,y), using the drawing color and alpha. A # symbol or carriage return chr(13) or linefeed chr(10) are interpreted as newline characters. In this way you can draw multi-line texts. (Use \# to get the # symbol itself.)
draw_text_ext(x,y,string,sep,w) Similar to the previous routine but you can specify two more things. First of all, sep indicates the separation distance between the lines of text in a multiline text. Use -1 to get the default distance. Use w to indicate the width of the text in pixels. Lines that are longer than this width are split- up at spaces or - signs. Use -1 to not split up lines.
string_width(string) Width of the string in the current font as it would be drawn using the draw_text() function. Can be used for precisely positioning graphics.
string_height(string) Height of the string in the current font as it would be drawn using the draw_text() function.
string_width_ext(string,sep,w) Width of the string in the current font as it would be drawn using the draw_text_ext() function. Can be used for precisely positioning graphics.
string_height_ext(string,sep,w) Height of the string in the current font as it would be drawn using the draw_text_ext() function.
The following routines allow you to draw scaled and rotated text and also to use gradient colors on texts.
draw_text_transformed(x,y,string,xscale,yscale,angle) Draws the string at position (x,y) in the same way as above, but scale it horizontally and vertically with the indicated factors and rotate it counter-clockwise over angle degrees.
draw_text_ext_transformed(x,y,string,sep,w,xscale,yscale,angle) Combines the function draw_text_ext and draw_text_transformed. It makes it possible to draw a multi-line text rotated and scaled.
draw_text_color(x,y,string,c1,c2,c3,c4,alpha) Draws the string at position (x,y) like above. The four colors specify the colors of the top-left, top-right, bottom-right, and bottom-left corner of the text. alpha is the alpha transparency to be used (0-1).
draw_text_ext_color(x,y,string,sep,w,c1,c2,c3,c4,alpha) Similar to draw_text_ext() but with colored vertices.
draw_text_transformed_color(x,y,string,xscale,yscale,angle,c1,c2,c3,c4,alpha) Similar to draw_text_transformed() but with colored vertices.
draw_text_ext_transformed_color(x,y,string,sep,w,xscale,yscale,angle,c1,c2,c3,c4,alpha) Similar to draw_text_ext_transformed() but with colored vertices.
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |