diff options
-rw-r--r-- | doc/classes/CharFXTransform.xml | 23 | ||||
-rw-r--r-- | doc/classes/RichTextEffect.xml | 11 | ||||
-rw-r--r-- | doc/classes/StyleBoxFlat.xml | 18 | ||||
-rw-r--r-- | doc/classes/StyleBoxLine.xml | 7 | ||||
-rw-r--r-- | doc/classes/StyleBoxTexture.xml | 15 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 6 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 6 |
7 files changed, 76 insertions, 10 deletions
diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml index e03229abe1..399530bb5d 100644 --- a/doc/classes/CharFXTransform.xml +++ b/doc/classes/CharFXTransform.xml @@ -1,10 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CharFXTransform" inherits="Reference" category="Core" version="3.2"> <brief_description> + Controls how an individual character will be displayed in a [RichTextEffect]. </brief_description> <description> + By setting various properties on this object, you can control how individual characters will be displayed in a [RichTextEffect]. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> + <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> </tutorials> <methods> <method name="get_value_or"> @@ -15,25 +19,44 @@ <argument index="1" name="default_value" type="Variant"> </argument> <description> + Returns the value for [code]key[/code] in the [member env] [Dictionary], or [code]default_value[/code] if [code]key[/code] isn't defined in [member env]. If the value's type doesn't match [code]default_value[/code]'s type, this method will return [code]default_value[/code]. </description> </method> </methods> <members> <member name="absolute_index" type="int" setter="set_absolute_index" getter="get_absolute_index" default="0"> + The index of the current character (starting from 0). Setting this property won't affect drawing. </member> <member name="character" type="int" setter="set_character" getter="get_character" default="0"> + 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: + [codeblock] + # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. + # See the RichTextEffect documentation for details. + char_fx.character = ord("*") + [/codeblock] </member> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )"> + The color the character will be drawn with. </member> <member name="elapsed_time" type="float" setter="set_elapsed_time" getter="get_elapsed_time" default="0.0"> + 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]. + [b]Note:[/b] Time still passes while the [RichTextLabel] is hidden. </member> <member name="env" type="Dictionary" setter="set_environment" getter="get_environment" default="{}"> + 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. + For example, the opening BBCode tag [code][example foo=hello bar=true baz=42 color=#ffffff][/code] will map to the following [Dictionary]: + [codeblock] + {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} + [/codeblock] </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> + The position offset the character will be drawn with (in pixels). </member> <member name="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0"> + The index of the current character (starting from 0). Setting this property won't affect drawing. </member> <member name="visible" type="bool" setter="set_visibility" getter="is_visible" default="true"> + 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. </member> </members> <constants> diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml index 5c3ffd9cff..0e043b1d50 100644 --- a/doc/classes/RichTextEffect.xml +++ b/doc/classes/RichTextEffect.xml @@ -1,10 +1,20 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="RichTextEffect" inherits="Resource" category="Core" version="3.2"> <brief_description> + A custom effect for use with [RichTextLabel]. </brief_description> <description> + A custom effect for use with [RichTextLabel]. + [b]Note:[/b] For a [RichTextEffect] to be usable, a BBCode tag must be defined as a member variable called [code]bbcode[/code] in the script. + [codeblock] + # The RichTextEffect will be usable like this: `[example]Some text[/example]` + var bbcode = "example" + [/codeblock] + [b]Note:[/b] As soon as a [RichTextLabel] contains at least one [RichTextEffect], it will continuously process the effect unless the project is paused. This may impact battery life negatively. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> + <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> </tutorials> <methods> <method name="_process_custom_fx" qualifiers="virtual"> @@ -13,6 +23,7 @@ <argument index="0" name="char_fx" type="CharFXTransform"> </argument> <description> + Override this method to modify properties in [code]char_fx[/code]. The method must return [code]true[/code] if the character could be transformed successfully. If the method returns [code]false[/code], it will skip transformation to avoid displaying broken text. </description> </method> </methods> diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 05ee79eef2..46b11ac010 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.2"> <brief_description> - Customizable Stylebox with a given set of parameters. (no texture required) + Customizable [StyleBox] with a given set of parameters (no texture required). </brief_description> <description> - This stylebox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable: + This [StyleBox] can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable: - Color - Border width (individual width for each border) - Rounded corners (individual radius for each corner) - - Shadow + - Shadow (with blur and offset) Setting corner radius to high values is allowed. As soon as corners would overlap, the stylebox will switch to a relative system. Example: [codeblock] height = 30 @@ -30,12 +30,14 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the given [code]margin[/code]'s border width. See [enum Margin] for possible values. </description> </method> <method name="get_border_width_min" qualifiers="const"> <return type="int"> </return> <description> + Returns the smallest border width out of all four borders. </description> </method> <method name="get_corner_radius" qualifiers="const"> @@ -44,6 +46,7 @@ <argument index="0" name="corner" type="int" enum="Corner"> </argument> <description> + Returns the given [code]corner[/code]'s radius. See [enum Corner] for possible values. </description> </method> <method name="get_expand_margin" qualifiers="const"> @@ -52,6 +55,7 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values. </description> </method> <method name="set_border_width"> @@ -62,6 +66,7 @@ <argument index="1" name="width" type="int"> </argument> <description> + Sets the border width to [code]width[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. </description> </method> <method name="set_border_width_all"> @@ -70,6 +75,7 @@ <argument index="0" name="width" type="int"> </argument> <description> + Sets the border width to [code]width[/code] pixels for all margins. </description> </method> <method name="set_corner_radius"> @@ -80,6 +86,7 @@ <argument index="1" name="radius" type="int"> </argument> <description> + Sets the corner radius to [code]radius[/code] pixels for the given [code]corner[/code]. See [enum Corner] for possible values. </description> </method> <method name="set_corner_radius_all"> @@ -88,6 +95,7 @@ <argument index="0" name="radius" type="int"> </argument> <description> + Sets the corner radius to [code]radius[/code] pixels for all corners. </description> </method> <method name="set_corner_radius_individual"> @@ -102,6 +110,7 @@ <argument index="3" name="radius_bottom_left" type="int"> </argument> <description> + Sets the corner radius for each corner to [code]radius_top_left[/code], [code]radius_top_right[/code], [code]radius_bottom_right[/code], and [code]radius_bottom_left[/code] pixels. </description> </method> <method name="set_expand_margin"> @@ -112,6 +121,7 @@ <argument index="1" name="size" type="float"> </argument> <description> + Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. </description> </method> <method name="set_expand_margin_all"> @@ -120,6 +130,7 @@ <argument index="0" name="size" type="float"> </argument> <description> + Sets the expand margin to [code]size[/code] pixels for all margins. </description> </method> <method name="set_expand_margin_individual"> @@ -134,6 +145,7 @@ <argument index="3" name="size_bottom" type="float"> </argument> <description> + Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels. </description> </method> </methods> diff --git a/doc/classes/StyleBoxLine.xml b/doc/classes/StyleBoxLine.xml index c0745c5f39..b5da81de79 100644 --- a/doc/classes/StyleBoxLine.xml +++ b/doc/classes/StyleBoxLine.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="StyleBoxLine" inherits="StyleBox" category="Core" version="3.2"> <brief_description> + [StyleBox] that displays a single line. </brief_description> <description> + [StyleBox] that displays a single line of a given color and thickness. It can be used to draw things like separators. </description> <tutorials> </tutorials> @@ -10,14 +12,19 @@ </methods> <members> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )"> + The line's color. </member> <member name="grow_begin" type="float" setter="set_grow_begin" getter="get_grow_begin" default="1.0"> + The number of pixels the line will extend before the [StyleBoxLine]'s bounds. If set to a negative value, the line will begin inside the [StyleBoxLine]'s bounds. </member> <member name="grow_end" type="float" setter="set_grow_end" getter="get_grow_end" default="1.0"> + The number of pixels the line will extend past the [StyleBoxLine]'s bounds. If set to a negative value, the line will end inside the [StyleBoxLine]'s bounds. </member> <member name="thickness" type="int" setter="set_thickness" getter="get_thickness" default="1"> + The line's thickness in pixels. </member> <member name="vertical" type="bool" setter="set_vertical" getter="is_vertical" default="false"> + If [code]true[/code], the line will be vertical. If [code]false[/code], the line will be horizontal. </member> </members> <constants> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index d5efc80846..af4186dcb6 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -15,6 +15,7 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values. </description> </method> <method name="get_margin_size" qualifiers="const"> @@ -23,6 +24,7 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values. </description> </method> <method name="set_expand_margin_all"> @@ -31,6 +33,7 @@ <argument index="0" name="size" type="float"> </argument> <description> + Sets the expand margin to [code]size[/code] pixels for all margins. </description> </method> <method name="set_expand_margin_individual"> @@ -45,6 +48,7 @@ <argument index="3" name="size_bottom" type="float"> </argument> <description> + Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels. </description> </method> <method name="set_expand_margin_size"> @@ -55,6 +59,7 @@ <argument index="1" name="size" type="float"> </argument> <description> + Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. </description> </method> <method name="set_margin_size"> @@ -65,15 +70,19 @@ <argument index="1" name="size" type="float"> </argument> <description> + Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values. </description> </method> </methods> <members> <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0"> + Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values. </member> <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0"> + Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values. </member> <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true"> + If [code]true[/code], the nine-patch texture's center tile will be drawn. </member> <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0"> Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. @@ -114,7 +123,7 @@ The normal map to use when drawing this style box. </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> - Species a sub region of the texture to use. + Species a sub-region of the texture to use. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> @@ -124,15 +133,19 @@ <signals> <signal name="texture_changed"> <description> + Emitted when the stylebox's texture is changed. </description> </signal> </signals> <constants> <constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode"> + Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. </constant> <constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode"> + Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. </constant> <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode"> + Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [constant AXIS_STRETCH_MODE_TILE], the texture may be slightly stretched to make the nine-patch texture tile seamlessly. </constant> </constants> </class> diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 2db4f03859..ea01f127b3 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -916,16 +916,16 @@ void EditorFileDialog::update_filters() { if (max_filters < filters.size()) all_filters += ", ..."; - filter->add_item(TTR("All Recognized") + " ( " + all_filters + " )"); + filter->add_item(TTR("All Recognized") + " (" + all_filters + ")"); } for (int i = 0; i < filters.size(); i++) { String flt = filters[i].get_slice(";", 0).strip_edges(); String desc = filters[i].get_slice(";", 1).strip_edges(); if (desc.length()) - filter->add_item(desc + " ( " + flt + " )"); + filter->add_item(desc + " (" + flt + ")"); else - filter->add_item("( " + flt + " )"); + filter->add_item("(" + flt + ")"); } filter->add_item(TTR("All Files (*)")); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 6400061309..a76e99f304 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -567,16 +567,16 @@ void FileDialog::update_filters() { if (max_filters < filters.size()) all_filters += ", ..."; - filter->add_item(RTR("All Recognized") + " ( " + all_filters + " )"); + filter->add_item(RTR("All Recognized") + " (" + all_filters + ")"); } for (int i = 0; i < filters.size(); i++) { String flt = filters[i].get_slice(";", 0).strip_edges(); String desc = filters[i].get_slice(";", 1).strip_edges(); if (desc.length()) - filter->add_item(String(tr(desc)) + " ( " + flt + " )"); + filter->add_item(String(tr(desc)) + " (" + flt + ")"); else - filter->add_item("( " + flt + " )"); + filter->add_item("(" + flt + ")"); } filter->add_item(RTR("All Files (*)")); |