String_width_line - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

NOTOC

Notation

Description

Returns the width in pixels of the indicated line of the string in the current drawing font. Line starts at 0, so 1 is line two, 2 is line three and so on. This function is usually used to precisely position graphics and text.

Parameters

  • string: The string for which the width should be returned.
  • line: The line for which the width should be returned.

Return Values

Returns the width in pixels.

Example Call

//draws a line above the first line of the string
draw_text(10,10,"Some text#This is a longer line two");
w=string_width_line("Some text#This is a longer line two",0);
draw_line(10,10,10+w,10);