Michael Stearns
Member
Hello! I've got a text box that gradually fills with text, typewriter-style. I wanted to draw a little "cursor" at the end of the string being displayed, but I seem to be having some trouble.
The problem is that string_width (and string_width_ext) does not seem to actually return the line width, instead it returns the width of the "box" containing the string. When my displayed string "breaks" (like by using \n) to a new line, string_width doesn't change its value until the length of the new line exceeds the earlier one (that is, the "box" width has increased).
I can think of some workarounds here (breaking up the strings more, using a fixed-width font) but it seems like there must just be some function or feature of a function that I'm missing?
The problem is that string_width (and string_width_ext) does not seem to actually return the line width, instead it returns the width of the "box" containing the string. When my displayed string "breaks" (like by using \n) to a new line, string_width doesn't change its value until the length of the new line exceeds the earlier one (that is, the "box" width has increased).
I can think of some workarounds here (breaking up the strings more, using a fixed-width font) but it seems like there must just be some function or feature of a function that I'm missing?