0 votes

I'm ussing BBCode RichTextEffects to hide text. The text only turns invisable but doesn't behave as it would in 3.5 or as the 4.10 documentation states it should.

@tool
extends RichTextEffect
class_name HideText

var bbcode := "hide"

func _process_custom_fx( char_fx : CharFXTransform) -> bool :
    if Settings.hide == true :
        char_fx.set_visibility( false )
    return true  

Unparsed text:
"Integer vitae justo eget magna fermentum iaculis eu non diam.[no_hide]

This should show. [/no_hide][hide]

This should be hidden..[/hide]

Convallis a cras semper auctor neque vitae tempus quam. Integer vitae justo eget magna fermentum iaculis eu non diam."


output looks like this :
"Integer vitae justo eget magna fermentum iaculis eu non diam.

This should show.

invisible, selectable, space-consuming characters be here!!!!!

Convallis a cras semper auctor neque vitae tempus quam. Integer vitae justo eget magna fermentum iaculis eu non diam."

The [hide] tag "works", in that it hides the text. The issue is that you can still select, copy and paste this "hidden" text and it still takes up space. The documentation says that the text should move to take up this space and that if I didn't want this, I should set the Alpha to 0 instead. But it seems like setting the Alpha to 0 is exactly what this char_fx is actually doing, rather than hiding the text and shifting the visible characters as the documentation implies.

I switched to 4.10 because 3.5 would hide the text but the control would still size itself as if the text was still there. I just can't seem win... sigh.

Godot version 4.10 Beta
in Engine by (56 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.