summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-23 00:43:33 +0100
committerGitHub <noreply@github.com>2021-12-23 00:43:33 +0100
commit1906b59675ce807d3be35924a1b4338976061e0f (patch)
tree38fc7e228cdd2b97142f4def8df0b46c1489560d /doc/classes
parent650b77340dcf1e20c744c941ec07b596fc37974f (diff)
parentad4408d4134a17b9c74c9772ee1d29f463d9f4cb (diff)
Merge pull request #55636 from bruvzg/vis_char_modes
Add different "visible characters" behavior modes.
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Label.xml20
-rw-r--r--doc/classes/RichTextLabel.xml18
2 files changed, 38 insertions, 0 deletions
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index e1d8b9e9f4..bdf451e710 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -82,6 +82,7 @@
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="2" />
<member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" default="1.0">
Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
+ [b]Note:[/b] Setting this property updates [member visible_characters] based on current [method get_total_character_count].
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="4" />
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
@@ -107,6 +108,10 @@
</member>
<member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1">
Restricts the number of characters to display. Set to -1 to disable.
+ [b]Note:[/b] Setting this property updates [member percent_visible] based on current [method get_total_character_count].
+ </member>
+ <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="Label.VisibleCharactersBehavior" default="0">
+ Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum VisibleCharactersBehavior] for more info.
</member>
</members>
<constants>
@@ -137,6 +142,21 @@
<constant name="OVERRUN_TRIM_WORD_ELLIPSIS" value="4" enum="OverrunBehavior">
Trims the text per word and adds an ellipsis to indicate that parts are hidden.
</constant>
+ <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior">
+ Trims text before the shaping. e.g, increasing [member visible_characters] value is visually identical to typing the text.
+ </constant>
+ <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior">
+ Displays glyphs that are mapped to the first [member visible_characters] characters from the beginning of the text.
+ </constant>
+ <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior">
+ Displays [member percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value.
+ </constant>
+ <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior">
+ Displays [member percent_visible] glyphs, starting from the left.
+ </constant>
+ <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior">
+ Displays [member percent_visible] glyphs, starting from the right.
+ </constant>
</constants>
<theme_items>
<theme_item name="font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 1a6fa65f75..132ede7a0a 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -429,6 +429,9 @@
The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed.
[b]Note:[/b] Setting this property updates [member percent_visible] based on current [method get_total_character_count].
</member>
+ <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="RichTextLabel.VisibleCharactersBehavior" default="0">
+ Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum VisibleCharactersBehavior] for more info.
+ </member>
</members>
<signals>
<signal name="meta_clicked">
@@ -515,6 +518,21 @@
</constant>
<constant name="ITEM_CUSTOMFX" value="25" enum="ItemType">
</constant>
+ <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior">
+ Trims text before the shaping. e.g, increasing [member visible_characters] value is visually identical to typing the text.
+ </constant>
+ <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior">
+ Displays glyphs that are mapped to the first [member visible_characters] characters from the beginning of the text.
+ </constant>
+ <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior">
+ Displays [member percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value.
+ </constant>
+ <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior">
+ Displays [member percent_visible] glyphs, starting from the left.
+ </constant>
+ <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior">
+ Displays [member percent_visible] glyphs, starting from the right.
+ </constant>
</constants>
<theme_items>
<theme_item name="default_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">