class_richtexteffect.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A custom effect for use with :ref:`RichTextLabel<class_RichTextLabel>`.
  13. Methods
  14. -------
  15. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`_process_custom_fx<class_RichTextEffect_method__process_custom_fx>` **(** :ref:`CharFXTransform<class_CharFXTransform>` char_fx **)** virtual |
  17. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
  18. Description
  19. -----------
  20. A custom effect for use with :ref:`RichTextLabel<class_RichTextLabel>`.
  21. **Note:** For a ``RichTextEffect`` to be usable, a BBCode tag must be defined as a member variable called ``bbcode`` in the script.
  22. ::
  23. # The RichTextEffect will be usable like this: `[example]Some text[/example]`
  24. var bbcode = "example"
  25. **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.
  26. Tutorials
  27. ---------
  28. - :doc:`../tutorials/gui/bbcode_in_richtextlabel`
  29. - `https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project <https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project>`_
  30. Method Descriptions
  31. -------------------
  32. .. _class_RichTextEffect_method__process_custom_fx:
  33. - :ref:`bool<class_bool>` **_process_custom_fx** **(** :ref:`CharFXTransform<class_CharFXTransform>` char_fx **)** virtual
  34. 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.