class_richtexteffect.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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:`Reference<class_Reference>` **<** :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. ::
  15. # The RichTextEffect will be usable like this: `[example]Some text[/example]`
  16. var bbcode = "example"
  17. **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.
  18. Tutorials
  19. ---------
  20. - :doc:`../tutorials/ui/bbcode_in_richtextlabel`
  21. - `https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project <https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project>`__
  22. Methods
  23. -------
  24. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`_process_custom_fx<class_RichTextEffect_method__process_custom_fx>` **(** :ref:`CharFXTransform<class_CharFXTransform>` char_fx **)** |virtual| |
  26. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. Method Descriptions
  28. -------------------
  29. .. _class_RichTextEffect_method__process_custom_fx:
  30. - :ref:`bool<class_bool>` **_process_custom_fx** **(** :ref:`CharFXTransform<class_CharFXTransform>` char_fx **)** |virtual|
  31. 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.
  32. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  33. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  34. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`