class_richtexteffect.rst 3.2 KB

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