draw_text_ext_transformed_color

From ENIGMA

Jump to: navigation, search

This function is part of the function set Drawing text

Notation

draw_text_ext_transformed_color(x,y,string,sep,w,xscale,yscale,angle,c1,c2,c3,c4,alpha)

Description

Draws a regular text string with top left corner placed at (x,y) position using the specified corner colors c1, c2, c3, c4 and the specified alpha. Colors are interpolated between corners. xscale and yscale is the horizontal scale and vertical scale (default: 1). angle is the direction to which rotate the text. 0 is right direction and 90 is up. Newlines are placed sep pixels below the previous line (top to top). Lines longer than w are split at spaces.

A # symbol or carriage return chr(13) or linefeed chr(10) are interpreted as newline characters. Note that EDL string settings can allow you to use the \n escape sequence in place of the # symbol.

To change the text alignment you can use draw_set_valign(alignment) and draw_set_halign(alignment) functions.

Parameters

  • x, y: The coordinates to draw the text at. (0,0) indicates the top-left corner of the room.
  • string: The textual string to display.
  • sep indicates the separation distance between the lines of text in a multiline text. Use -1 to get the default distance. Note that this distance is from the top of each line to the next top. So small distances will make the text to overlap. This means that the default sep is string_height(string).
  • w is the width of the text in pixels. Lines that are longer than this width are split up at spaces. Use -1 to not split up lines. Font size does make an impact where the lines will be split, because width is in pixels and so you can have 10 small words or one big one in a specific size.
  • xscale: Horizontal scaling of the text. Value of 1 being no scaling.
  • yscale: Vertical scaling of the text. Value of 1 being no scaling.
  • angle: Direction to which rotate the text. 0 is right direction and 90 is up.
  • c1: Color of the top left corner of the string.
  • c2: Color of the top right corner of the string.
  • c3: Color of the bottom right corner of the string.
  • c4: Color of the bottom left corner of the string.
  • alpha: Alpha component for the color.

Return Values

none

Example Call

str = 'This is colored, scale and rotated text which will be split when a line exceeds 200 pixels';
draw_text_ext_transformed_color(200,200,str,-1,200,2,2,-45,c_red,c_lime,c_teal,c_yellow,0.8);
Personal tools