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
Changes to RichTextLabel's text property have no effect to text previously entered with append_text()
Due to the particular way that RichTextLabel works, with the stack and everything, it's important to highlight that this behavior is NOT consistent with the documentation, see:
Description
Any edits made to text will erase previous edits made from other manual sources such as append_text()
Workaround
The workaround is to use clear(), despite the documentation explicitly says that just setting text should be enough:
void clear()
Clears the tag stack.
Note: This method will not modify text, but setting text to an empty string also clears the stack.
Steps to reproduce
Example project provided.
Alternatively:
Steps
Change the RichTextLabel with append_text()
Later, through a button, attempt to clear the label with $RichTextLabel.text = ""
Add some more text with append_text()
The new text is going to be appended to the previously added text that was supposed to have been cleared.
Tested versions
Godot Engine v4.2.2.stable.official
System information
Xubuntu 22.04.4 LTS
Issue description
Changes to RichTextLabel's
text
property have no effect to text previously entered withappend_text()
Due to the particular way that RichTextLabel works, with the stack and everything, it's important to highlight that this behavior is NOT consistent with the documentation, see:
Workaround
The workaround is to use
clear()
, despite the documentation explicitly says that just settingtext
should be enough:Steps to reproduce
Example project provided.
Alternatively:
Steps
append_text()
$RichTextLabel.text = ""
append_text()
Minimal reproduction project (MRP)
RichTextLabelBug.zip
The text was updated successfully, but these errors were encountered: