diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/AnimationNodeStateMachineTransition.xml | 3 | ||||
-rw-r--r-- | doc/classes/AnimationNodeTransition.xml | 4 | ||||
-rw-r--r-- | doc/classes/BaseMaterial3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Button.xml | 2 | ||||
-rw-r--r-- | doc/classes/CheckBox.xml | 2 | ||||
-rw-r--r-- | doc/classes/CheckButton.xml | 2 | ||||
-rw-r--r-- | doc/classes/EditorInterface.xml | 7 | ||||
-rw-r--r-- | doc/classes/EditorPlugin.xml | 2 | ||||
-rw-r--r-- | doc/classes/EditorUndoRedoManager.xml | 118 | ||||
-rw-r--r-- | doc/classes/JSON.xml | 17 | ||||
-rw-r--r-- | doc/classes/MenuButton.xml | 2 | ||||
-rw-r--r-- | doc/classes/OptionButton.xml | 2 |
12 files changed, 153 insertions, 10 deletions
diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index 0badb831de..beb259b12b 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -37,6 +37,9 @@ <member name="switch_mode" type="int" setter="set_switch_mode" getter="get_switch_mode" enum="AnimationNodeStateMachineTransition.SwitchMode" default="0"> The transition type. </member> + <member name="xfade_curve" type="Curve" setter="set_xfade_curve" getter="get_xfade_curve"> + Ease curve for better control over cross-fade between this state and the next. + </member> <member name="xfade_time" type="float" setter="set_xfade_time" getter="get_xfade_time" default="0.0"> The time to cross-fade between this state and the next. </member> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index a5de170ccd..d574bc044d 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -46,7 +46,9 @@ <member name="input_count" type="int" setter="set_enabled_inputs" getter="get_enabled_inputs" default="0"> The number of available input ports for this node. </member> - <member name="xfade_time" type="float" setter="set_cross_fade_time" getter="get_cross_fade_time" default="0.0"> + <member name="xfade_curve" type="Curve" setter="set_xfade_curve" getter="get_xfade_curve"> + </member> + <member name="xfade_time" type="float" setter="set_xfade_time" getter="get_xfade_time" default="0.0"> Cross-fading time (in seconds) between each animation connected to the inputs. </member> </members> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 044e2db5a3..fcdf59e36e 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -398,6 +398,7 @@ </member> <member name="uv1_triplanar_sharpness" type="float" setter="set_uv1_triplanar_blend_sharpness" getter="get_uv1_triplanar_blend_sharpness" default="1.0"> A lower number blends the texture more softly while a higher number blends the texture more sharply. + [b]Note:[/b] [member uv1_triplanar_sharpness] is clamped between [code]0.0[/code] and [code]150.0[/code] (inclusive) as values outside that range can look broken depending on the mesh. </member> <member name="uv1_world_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], triplanar mapping for [code]UV[/code] is calculated in world space rather than object local space. See also [member uv1_triplanar]. @@ -413,6 +414,7 @@ </member> <member name="uv2_triplanar_sharpness" type="float" setter="set_uv2_triplanar_blend_sharpness" getter="get_uv2_triplanar_blend_sharpness" default="1.0"> A lower number blends the texture more softly while a higher number blends the texture more sharply. + [b]Note:[/b] [member uv2_triplanar_sharpness] is clamped between [code]0.0[/code] and [code]150.0[/code] (inclusive) as values outside that range can look broken depending on the mesh. </member> <member name="uv2_world_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], triplanar mapping for [code]UV2[/code] is calculated in world space rather than object local space. See also [member uv2_triplanar]. diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 1cd9ca0afb..e78cdfc951 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -114,7 +114,7 @@ Icon modulate [Color] used when the [Button] is being pressed. </theme_item> <theme_item name="h_separation" data_type="constant" type="int" default="2"> - The horizontal space between [Button]'s icon and text. + The horizontal space between [Button]'s icon and text. Negative values will be treated as [code]0[/code] when used. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 6483faf763..d39b75ae52 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -39,7 +39,7 @@ The vertical offset used when rendering the check icons (in pixels). </theme_item> <theme_item name="h_separation" data_type="constant" type="int" default="4"> - The separation between the check icon and the text (in pixels). + The separation between the check icon and the text (in pixels). Negative values will be treated as [code]0[/code] when used. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index 51b0411f4e..f49da69926 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -39,7 +39,7 @@ The vertical offset used when rendering the toggle icons (in pixels). </theme_item> <theme_item name="h_separation" data_type="constant" type="int" default="4"> - The separation between the toggle icon and the text (in pixels). + The separation between the toggle icon and the text (in pixels). Negative values will be treated as [code]0[/code] when used. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 1dd53e1394..beed364974 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -206,6 +206,13 @@ Reloads the scene at the given path. </description> </method> + <method name="restart_editor"> + <return type="void" /> + <param index="0" name="save" type="bool" default="true" /> + <description> + Restarts the editor. This closes the editor and then opens the same project. If [param save] is [code]true[/code], the project will be saved before restarting. + </description> + </method> <method name="save_scene"> <return type="int" enum="Error" /> <description> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 5a1037aebe..fdd3807b69 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -532,7 +532,7 @@ </description> </method> <method name="get_undo_redo"> - <return type="UndoRedo" /> + <return type="EditorUndoRedoManager" /> <description> Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. </description> diff --git a/doc/classes/EditorUndoRedoManager.xml b/doc/classes/EditorUndoRedoManager.xml new file mode 100644 index 0000000000..1350e4487c --- /dev/null +++ b/doc/classes/EditorUndoRedoManager.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="EditorUndoRedoManager" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Manages undo history of scenes opened in the editor. + </brief_description> + <description> + [EditorUndoRedoManager] is a manager for [UndoRedo] objects associated with edited scenes. Each scene has its own undo history and [EditorUndoRedoManager] ensures that each action performed in the editor gets associated with a proper scene. For actions not related to scenes ([ProjectSettings] edits, external resources, etc.), a separate global history is used. + The usage is mostly the same as [UndoRedo]. You create and commit actions and the manager automatically decides under-the-hood what scenes it belongs to. The scene is deduced based on the first operation in an action, using the object from the operation. The rules are as follows: + - If the object is a [Node], use the currently edited scene; + - If the object is a built-in resource, use the scene from its path; + - If the object is external resource or anything else, use global history. + This guessing can sometimes yield false results, so you can provide a custom context object when creating an action. + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_do_method" qualifiers="vararg"> + <return type="void" /> + <param index="0" name="object" type="Object" /> + <param index="1" name="method" type="StringName" /> + <description> + Register a method that will be called when the action is committed (i.e. the "do" action). + If this is the first operation, the [param object] will be used to deduce target undo history. + </description> + </method> + <method name="add_do_property"> + <return type="void" /> + <param index="0" name="object" type="Object" /> + <param index="1" name="property" type="StringName" /> + <param index="2" name="value" type="Variant" /> + <description> + Register a property value change for "do". + If this is the first operation, the [param object] will be used to deduce target undo history. + </description> + </method> + <method name="add_do_reference"> + <return type="void" /> + <param index="0" name="object" type="Object" /> + <description> + Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. + </description> + </method> + <method name="add_undo_method" qualifiers="vararg"> + <return type="void" /> + <param index="0" name="object" type="Object" /> + <param index="1" name="method" type="StringName" /> + <description> + Register a method that will be called when the action is undone (i.e. the "undo" action). + If this is the first operation, the [param object] will be used to deduce target undo history. + </description> + </method> + <method name="add_undo_property"> + <return type="void" /> + <param index="0" name="object" type="Object" /> + <param index="1" name="property" type="StringName" /> + <param index="2" name="value" type="Variant" /> + <description> + Register a property value change for "undo". + If this is the first operation, the [param object] will be used to deduce target undo history. + </description> + </method> + <method name="add_undo_reference"> + <return type="void" /> + <param index="0" name="object" type="Object" /> + <description> + Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). + </description> + </method> + <method name="commit_action"> + <return type="void" /> + <param index="0" name="execute" type="bool" default="true" /> + <description> + Commit the action. If [param execute] is true (default), all "do" methods/properties are called/set when this function is called. + </description> + </method> + <method name="create_action"> + <return type="void" /> + <param index="0" name="name" type="String" /> + <param index="1" name="merge_mode" type="int" enum="UndoRedo.MergeMode" default="0" /> + <param index="2" name="custom_context" type="Object" default="null" /> + <description> + Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property], and [method add_undo_property], then commit the action with [method commit_action]. + The way actions are merged is dictated by the [param merge_mode] argument. See [enum UndoRedo.MergeMode] for details. + If [param custom_context] object is provided, it will be used for deducing target history (instead of using the first operation). + </description> + </method> + <method name="get_history_undo_redo" qualifiers="const"> + <return type="UndoRedo" /> + <param index="0" name="id" type="int" /> + <description> + Returns the [UndoRedo] object associated with the given history [param id]. + [param id] above [code]0[/code] are mapped to the opened scene tabs (but it doesn't match their order). [param id] of [code]0[/code] or lower have special meaning (see [enum SpecialHistory]). + Best used with [method get_object_history_id]. This method is only provided in case you need some more advanced methods of [UndoRedo] (but keep in mind that directly operating on the [UndoRedo] object might affect editor's stability). + </description> + </method> + <method name="get_object_history_id" qualifiers="const"> + <return type="int" /> + <param index="0" name="object" type="Object" /> + <description> + Returns the history ID deduced from the given [param object]. It can be used with [method get_history_undo_redo]. + </description> + </method> + <method name="is_committing_action" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the [EditorUndoRedoManager] is currently committing the action, i.e. running its "do" method or property change (see [method commit_action]). + </description> + </method> + </methods> + <constants> + <constant name="GLOBAL_HISTORY" value="0" enum="SpecialHistory"> + Global history not associated with any scene, but with external resources etc. + </constant> + <constant name="INVALID_HISTORY" value="-99" enum="SpecialHistory"> + Invalid "null" history. It's a special value, not associated with any object. + </constant> + </constants> +</class> diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml index 49ebb55a52..46e46cc164 100644 --- a/doc/classes/JSON.xml +++ b/doc/classes/JSON.xml @@ -10,8 +10,7 @@ [b]Example[/b] [codeblock] var data_to_send = ["a", "b", "c"] - var json = JSON.new() - var json_string = json.stringify(data_to_send) + var json_string = JSON.stringify(data_to_send) # Save data # ... # Retrieve data @@ -25,6 +24,10 @@ else: print("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line()) [/codeblock] + Alternatively, you can parse string using the static [method parse_string] method, but it doesn't allow to handle errors. + [codeblock] + var data = JSON.parse_string(json_string) # Returns null if parsing failed. + [/codeblock] </description> <tutorials> </tutorials> @@ -54,9 +57,17 @@ <description> Attempts to parse the [param json_string] provided. Returns an [enum Error]. If the parse was successful, it returns [code]OK[/code] and the result can be retrieved using [method get_data]. If unsuccessful, use [method get_error_line] and [method get_error_message] for identifying the source of the failure. + Non-static variant of [method parse_string], if you want custom error handling. + </description> + </method> + <method name="parse_string" qualifiers="static"> + <return type="Variant" /> + <param index="0" name="json_string" type="String" /> + <description> + Attempts to parse the [param json_string] provided and returns the parsed data. Returns [code]null[/code] if parse failed. </description> </method> - <method name="stringify"> + <method name="stringify" qualifiers="static"> <return type="String" /> <param index="0" name="data" type="Variant" /> <param index="1" name="indent" type="String" default="""" /> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 8baa724292..1f38510e83 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -65,7 +65,7 @@ Text [Color] used when the [MenuButton] is being pressed. </theme_item> <theme_item name="h_separation" data_type="constant" type="int" default="3"> - The horizontal space between [MenuButton]'s icon and text. + The horizontal space between [MenuButton]'s icon and text. Negative values will be treated as [code]0[/code] when used. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index a552a2c16c..f10c096c1b 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -246,7 +246,7 @@ The horizontal space between the arrow icon and the right edge of the button. </theme_item> <theme_item name="h_separation" data_type="constant" type="int" default="2"> - The horizontal space between [OptionButton]'s icon and text. + The horizontal space between [OptionButton]'s icon and text. Negative values will be treated as [code]0[/code] when used. </theme_item> <theme_item name="modulate_arrow" data_type="constant" type="int" default="0"> If different than [code]0[/code], the arrow icon will be modulated to the font color. |