You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Label's visible_characters is not considering space as a visible character.
Perhaps this is a logical fallacy (or someone's idea of a joke), but I just lost 12 hours of time in total, today and yesterday, trying to figure out why my sound wasn't syncing with text being displayed via Tween using Label's visible_characters.
It happened because - say, if a string contains 100 characters counted with someText.Count and now you base your calculations on that to calculate how long your sound effect should be played while Tween interpolates characters via visible_characters ... well, say that text has 30 spaces ... your calculations are now off 30 * durationPerChar simply because Label doesn't consider space to be a "visible character".
I'm saying this is a bug.
While space is a transparent character, it most definitely is not non-visible character - it takes space on the screen.
I can't envision any situation where it would be beneficial to anyone to not consider space to be a character as far as the visible_characters property goes.
As a workaround I switched to RichTextLabel which, logically, does consider space to be a visible character for this same purpose. However this discrepancy in behavior between Label and RichTextLabel has no justification in my mind.
Please consider fixing this - even if it's going to break all projects currently depending on the faulty behavior.
Thank you for your time.
Steps to reproduce
Use Tween's InterpolateProperty to interpolate text in Label from 0 to text.Count using visible_characters property.
Set Tween's duration to something like 5-10 seconds.
Do something else in sync by calculating steps based on text.Count and duration. The more text you interpolate the more obvious the issue becomes (as there are more spaces).
Connect a signal and do something when tween_completed fires.
What happens is - tween_completed does not fire when all the text has been made visible. The more spaces you have the longer it takes after that.
All this results in the calculations being off and you now have to either try to compensate and calculate how many spaces you have in each of your texts or switch to RichTextLabel which behaves correctly.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
Godot version
3.5.1.stable.mono.official [6fed1ff]
System information
Linux NVIDIA GLES3
Issue description
Label's visible_characters is not considering space as a visible character.
Perhaps this is a logical fallacy (or someone's idea of a joke), but I just lost 12 hours of time in total, today and yesterday, trying to figure out why my sound wasn't syncing with text being displayed via Tween using Label's
visible_characters
.It happened because - say, if a
string
contains 100 characters counted withsomeText.Count
and now you base your calculations on that to calculate how long your sound effect should be played while Tween interpolates characters viavisible_characters
... well, say that text has 30 spaces ... your calculations are now off30 * durationPerChar
simply becauseLabel
doesn't consider space to be a "visible character".I'm saying this is a bug.
While space is a transparent character, it most definitely is not non-visible character - it takes space on the screen.
I can't envision any situation where it would be beneficial to anyone to not consider space to be a character as far as the
visible_characters
property goes.As a workaround I switched to
RichTextLabel
which, logically, does consider space to be a visible character for this same purpose. However this discrepancy in behavior betweenLabel
andRichTextLabel
has no justification in my mind.Please consider fixing this - even if it's going to break all projects currently depending on the faulty behavior.
Thank you for your time.
Steps to reproduce
InterpolateProperty
to interpolate text in Label from 0 to text.Count usingvisible_characters
property.duration
to something like 5-10 seconds.text.Count
andduration
. The more text you interpolate the more obvious the issue becomes (as there are more spaces).tween_completed
fires.What happens is -
tween_completed
does not fire when all the text has been made visible. The more spaces you have the longer it takes after that.All this results in the calculations being off and you now have to either try to compensate and calculate how many spaces you have in each of your texts or switch to RichTextLabel which behaves correctly.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: