-
Notifications
You must be signed in to change notification settings - Fork 0
String_width_ext
hugh greene edited this page Jun 20, 2022
·
1 revision
Returns the width in pixels of the string in the current drawing font. sep is not used in this function and remains only for compatibility and consistency, so set it to whatever (usually -1). 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. This function is usually used to precisely position graphics and text.
- string: The string for which the width should be returned.
- sep: Separation parameter is not used in this function and remains only for compatibility and consistency, so set it to whatever (usually -1).
- 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. If -1 is used, then its better and faster to use instead.
Returns the width of the string in pixels.
//draws a line above the string
draw_text_ext(10,10,"Some text, that is split up", -1, 100);
w=string_width_ext("Some text, that is split up",-1,100);
draw_line(10,10,10+w,10);
NOTOC
edited by hpg678 on Github