class_richtexteffect.rst 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the RichTextEffect.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_RichTextEffect:
  6. RichTextEffect
  7. ==============
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. A custom effect for use with :ref:`RichTextLabel<class_RichTextLabel>`.
  10. Description
  11. -----------
  12. A custom effect for use with :ref:`RichTextLabel<class_RichTextLabel>`.
  13. \ **Note:** For a ``RichTextEffect`` to be usable, a BBCode tag must be defined as a member variable called ``bbcode`` in the script.
  14. .. tabs::
  15. .. code-tab:: gdscript
  16. # The RichTextEffect will be usable like this: `[example]Some text[/example]`
  17. var bbcode = "example"
  18. .. code-tab:: csharp
  19. // The RichTextEffect will be usable like this: `[example]Some text[/example]`
  20. public string bbcode = "example";
  21. \ **Note:** As soon as a :ref:`RichTextLabel<class_RichTextLabel>` contains at least one ``RichTextEffect``, it will continuously process the effect unless the project is paused. This may impact battery life negatively.
  22. Tutorials
  23. ---------
  24. - :doc:`BBCode in RichTextLabel <../tutorials/ui/bbcode_in_richtextlabel>`
  25. - `RichTextEffect test project (third-party) <https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project>`__
  26. Methods
  27. -------
  28. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`_process_custom_fx<class_RichTextEffect_method__process_custom_fx>` **(** :ref:`CharFXTransform<class_CharFXTransform>` char_fx **)** |virtual| |const| |
  30. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. Method Descriptions
  32. -------------------
  33. .. _class_RichTextEffect_method__process_custom_fx:
  34. - :ref:`bool<class_bool>` **_process_custom_fx** **(** :ref:`CharFXTransform<class_CharFXTransform>` char_fx **)** |virtual| |const|
  35. Override this method to modify properties in ``char_fx``. The method must return ``true`` if the character could be transformed successfully. If the method returns ``false``, it will skip transformation to avoid displaying broken text.
  36. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  37. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  38. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  39. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  40. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  41. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`