String_width_ext_line_count - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

NOTOC

Notation

Description

Returns the number of lines in a multiline 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.

Parameters

  • string: The string for which the line count should be returned.
  • w: 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.

Return Values

Returns the line count of the multiline string.

Example Call

str = "Some text that is quite long and keeps on going";
draw_text_ext(10,10,str,-1,150);
draw_text(170,10,"The string on the left has "+string(string_width_ext_line_count(str,150))+" lines.");