![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Paar |
Hi everyone! I’m trying to make Label node behave in particular way but so far without success. This is the behavior I want:
- Show maximum of 4 lines for a text that is longer than that
- Gradually reveal every letter by “visible_characters” property, but only for the 4 lines
- When all 4 lines are revealed, show blinking “continue” indicator
- After a key press show another 4 lines (or less if it’s the end of the text) with “skipped line” property and begin the “visible characters” animation again
However I’m stuck because I have no idea how to get the information about the text box being full (showing 4 lines) so I can show the “continue” indicator. I would be glad for any kind of help.
The best way would be making the system dynamic so I don’t have to format the text manually with every change in the Label node size.
Thanks!
A Label
has two methods that are probably helpful here…
get_line_count()
- returns the number of text lines in the label
get_visible_line_count()
- returns the number of visible lines in the label
Additionally, there are a few other methods that could be helpful in your solution. See the docs here.
jgodfrey | 2022-04-11 15:53
Those two functions are helpful, unfortunately not as much as I would love to.
get_line_count()
gives me all lines in the Label.
get_visible_line_count()
gives me number of visible lines in the Label, BUT (!) counting even characters that are not yet visible.
That means, when showing one character after another, I have no way of knowing if I show characters from the first four lines or from the others that are out of textbox boundaries.
Paar | 2022-04-11 17:23
{marked as deleted}
Paar | 2022-04-12 10:06