CharFXTransform.xml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CharFXTransform" inherits="Reference" version="3.4">
  3. <brief_description>
  4. Controls how an individual character will be displayed in a [RichTextEffect].
  5. </brief_description>
  6. <description>
  7. By setting various properties on this object, you can control how individual characters will be displayed in a [RichTextEffect].
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/3.3/tutorials/gui/bbcode_in_richtextlabel.html</link>
  11. <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
  12. </tutorials>
  13. <methods>
  14. </methods>
  15. <members>
  16. <member name="absolute_index" type="int" setter="set_absolute_index" getter="get_absolute_index" default="0">
  17. The index of the current character (starting from 0). Setting this property won't affect drawing.
  18. </member>
  19. <member name="character" type="int" setter="set_character" getter="get_character" default="0">
  20. The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks:
  21. [codeblock]
  22. # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`.
  23. # See the RichTextEffect documentation for details.
  24. char_fx.character = ord("*")
  25. [/codeblock]
  26. </member>
  27. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
  28. The color the character will be drawn with.
  29. </member>
  30. <member name="elapsed_time" type="float" setter="set_elapsed_time" getter="get_elapsed_time" default="0.0">
  31. The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops when the project is paused, unless the [RichTextLabel]'s [member Node.pause_mode] is set to [constant Node.PAUSE_MODE_PROCESS].
  32. [b]Note:[/b] Time still passes while the [RichTextLabel] is hidden.
  33. </member>
  34. <member name="env" type="Dictionary" setter="set_environment" getter="get_environment" default="{}">
  35. Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as [bool], [int] or [float], they will be converted automatically. Color codes in the form [code]#rrggbb[/code] or [code]#rgb[/code] will be converted to an opaque [Color]. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string.
  36. For example, the opening BBCode tag [code][example foo=hello bar=true baz=42 color=#ffffff][/code] will map to the following [Dictionary]:
  37. [codeblock]
  38. {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)}
  39. [/codeblock]
  40. </member>
  41. <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
  42. The position offset the character will be drawn with (in pixels).
  43. </member>
  44. <member name="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0">
  45. The index of the current character (starting from 0). Setting this property won't affect drawing.
  46. </member>
  47. <member name="visible" type="bool" setter="set_visibility" getter="is_visible" default="true">
  48. If [code]true[/code], the character will be drawn. If [code]false[/code], the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to [code]Color(1, 1, 1, 0)[/code] instead.
  49. </member>
  50. </members>
  51. <constants>
  52. </constants>
  53. </class>