From 215d18814e3db5371ed7aae9555ac25bf7d1a00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 4 Jan 2021 14:33:44 +0100 Subject: doc: Sync classref with current source --- doc/classes/@GlobalScope.xml | 32 +- doc/classes/AABB.xml | 2 +- doc/classes/Animation.xml | 4 +- doc/classes/AnimationNodeStateMachinePlayback.xml | 18 +- doc/classes/Array.xml | 16 +- doc/classes/ArrayMesh.xml | 10 +- doc/classes/Camera2D.xml | 14 +- doc/classes/CanvasItem.xml | 2 +- doc/classes/Color.xml | 4 +- doc/classes/Control.xml | 50 +- doc/classes/Dictionary.xml | 14 +- doc/classes/EditorInterface.xml | 14 +- doc/classes/EditorSceneImporterAssimp.xml | 36 - doc/classes/EditorSceneImporterGLTF.xml | 13 + doc/classes/EditorSceneImporterMesh.xml | 160 +++ doc/classes/EditorSceneImporterMeshNode3D.xml | 21 + doc/classes/EncodedObjectAsID.xml | 4 +- doc/classes/Engine.xml | 14 +- doc/classes/GLTFAccessor.xml | 43 + doc/classes/GLTFAnimation.xml | 17 + doc/classes/GLTFBufferView.xml | 25 + doc/classes/GLTFCamera.xml | 23 + doc/classes/GLTFDocument.xml | 13 + doc/classes/GLTFLight.xml | 27 + doc/classes/GLTFMesh.xml | 19 + doc/classes/GLTFNode.xml | 43 + doc/classes/GLTFSkeleton.xml | 67 ++ doc/classes/GLTFSkin.xml | 71 ++ doc/classes/GLTFSpecGloss.xml | 25 + doc/classes/GLTFState.xml | 251 +++++ doc/classes/GLTFTexture.xml | 17 + doc/classes/GeometryInstance3D.xml | 2 + doc/classes/GraphEdit.xml | 6 +- doc/classes/ItemList.xml | 32 +- doc/classes/JSONParseResult.xml | 2 +- doc/classes/MainLoop.xml | 24 +- doc/classes/Mesh.xml | 6 + doc/classes/NinePatchRect.xml | 4 +- doc/classes/Node3D.xml | 2 +- doc/classes/Object.xml | 2 +- doc/classes/PackedByteArray.xml | 14 +- doc/classes/PackedColorArray.xml | 14 +- doc/classes/PackedFloat32Array.xml | 14 +- doc/classes/PackedFloat64Array.xml | 14 +- doc/classes/PackedInt32Array.xml | 14 +- doc/classes/PackedInt64Array.xml | 14 +- doc/classes/PackedSceneGLTF.xml | 58 + doc/classes/PackedStringArray.xml | 14 +- doc/classes/PackedVector2Array.xml | 14 +- doc/classes/PackedVector3Array.xml | 14 +- doc/classes/Plane.xml | 2 +- doc/classes/ProjectSettings.xml | 8 + doc/classes/Quat.xml | 2 +- doc/classes/Rect2.xml | 22 +- doc/classes/Rect2i.xml | 22 +- doc/classes/ReflectionProbe.xml | 2 + doc/classes/RenderingDevice.xml | 2 + doc/classes/RenderingServer.xml | 38 +- doc/classes/SceneTree.xml | 12 +- doc/classes/String.xml | 14 +- doc/classes/StyleBox.xml | 6 +- doc/classes/StyleBoxFlat.xml | 8 +- doc/classes/StyleBoxTexture.xml | 8 +- doc/classes/SurfaceTool.xml | 40 +- doc/classes/TabContainer.xml | 6 +- doc/classes/TextureProgressBar.xml | 4 +- doc/classes/Variant.xml | 2 +- doc/classes/Vector2.xml | 26 +- doc/classes/Vector3.xml | 8 +- doc/classes/Viewport.xml | 4 + doc/classes/WeakRef.xml | 2 +- doc/classes/XRController3D.xml | 14 +- doc/classes/XRPositionalTracker.xml | 32 +- modules/fbx/doc_classes/EditorSceneImporterFBX.xml | 2 +- modules/gdscript/doc_classes/@GDScript.xml | 1149 +------------------- .../doc_classes/VisualScriptBuiltinFunc.xml | 2 +- 76 files changed, 1290 insertions(+), 1480 deletions(-) delete mode 100644 doc/classes/EditorSceneImporterAssimp.xml create mode 100644 doc/classes/EditorSceneImporterGLTF.xml create mode 100644 doc/classes/EditorSceneImporterMesh.xml create mode 100644 doc/classes/EditorSceneImporterMeshNode3D.xml create mode 100644 doc/classes/GLTFAccessor.xml create mode 100644 doc/classes/GLTFAnimation.xml create mode 100644 doc/classes/GLTFBufferView.xml create mode 100644 doc/classes/GLTFCamera.xml create mode 100644 doc/classes/GLTFDocument.xml create mode 100644 doc/classes/GLTFLight.xml create mode 100644 doc/classes/GLTFMesh.xml create mode 100644 doc/classes/GLTFNode.xml create mode 100644 doc/classes/GLTFSkeleton.xml create mode 100644 doc/classes/GLTFSkin.xml create mode 100644 doc/classes/GLTFSpecGloss.xml create mode 100644 doc/classes/GLTFState.xml create mode 100644 doc/classes/GLTFTexture.xml create mode 100644 doc/classes/PackedSceneGLTF.xml diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index c8f216e199..b40ae65a61 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -944,6 +944,22 @@ [/codeblock] + + + + + + + + + Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals. + [codeblock] + snapped(100, 32) # Returns 96 + snapped(3.14159, 0.01) # Returns 3.14 + [/codeblock] + See also [method ceil], [method floor], and [method round]. + + @@ -974,22 +990,6 @@ [/codeblock] - - - - - - - - - Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals. - [codeblock] - snapped(100, 32) # Returns 96 - snapped(3.14159, 0.01) # Returns 3.14 - [/codeblock] - See also [method ceil], [method floor], and [method round]. - - diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index baea84df65..8cd7e6f5fa 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -219,7 +219,7 @@ - Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [method @GDScript.is_equal_approx] on each component. + Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component. diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 3e33a879b3..d26c0e8605 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -409,7 +409,7 @@ - Returns the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease]). + Returns the transition curve (easing) for a specific key (see the built-in math function [method @GlobalScope.ease]). @@ -592,7 +592,7 @@ - Sets the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease]). + Sets the transition curve (easing) for a specific key (see the built-in math function [method @GlobalScope.ease]). diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml index 4dc88ffa56..c8468f9c8f 100644 --- a/doc/classes/AnimationNodeStateMachinePlayback.xml +++ b/doc/classes/AnimationNodeStateMachinePlayback.xml @@ -21,18 +21,17 @@ https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html - - + + - Returns the currently playing animation state. - - + + - Returns the current travel path as computed internally by the A* algorithm. + Returns the currently playing animation state. @@ -42,6 +41,13 @@ Returns the playback position within the current animation state. + + + + + Returns the current travel path as computed internally by the A* algorithm. + + diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index e4f9dcf993..db5d377c62 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -228,13 +228,6 @@ If [code]deep[/code] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -339,6 +332,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + @@ -482,7 +482,7 @@ - Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GDScript.randi]. Call [method @GDScript.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling. + Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GlobalScope.randi]. Call [method @GlobalScope.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling. diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index 59502e7017..1f532f4843 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -209,19 +209,13 @@ - - Sets the blend shape mode to one of [enum ArrayMesh.BlendShapeMode]. + + Sets the blend shape mode to one of [enum Mesh.BlendShapeMode]. Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. - - Blend shapes are normalized. - - - Blend shapes are relative to base weight. - diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index f17c56fb11..2a4e726d43 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -52,7 +52,7 @@ - + Returns the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. @@ -61,7 +61,7 @@ - + Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. @@ -85,7 +85,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -118,10 +118,10 @@ Bottom margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the bottom edge of the screen. - + If [code]true[/code], the camera only moves when reaching the horizontal (left and right) drag margins. If [code]false[/code], the camera moves horizontally regardless of margins. - + The relative horizontal drag offset of the camera between the right ([code]-1[/code]) and left ([code]1[/code]) drag margins. [b]Note:[/b] Used to set the initial horizontal drag offset; determine the current offset; or force the current offset. It's not automatically updated when the horizontal drag margin is enabled or the drag margins are changed. @@ -137,7 +137,7 @@ If [code]true[/code], the camera only moves when reaching the vertical (top and bottom) drag margins. If [code]false[/code], the camera moves vertically regardless of the drag margins. - + The relative vertical drag offset of the camera between the bottom ([code]-1[/code]) and top ([code]1[/code]) drag margins. [b]Note:[/b] Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when the vertical drag margin is enabled or the drag margins are changed. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index fcdd072c80..d13f431a16 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -9,7 +9,7 @@ Canvas items are drawn in tree order. By default, children are on top of their parents so a root [CanvasItem] will be drawn behind everything. This behavior can be changed on a per-item basis. A [CanvasItem] can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode. Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed. - [b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad]. + [b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GlobalScope.deg2rad]. https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 755fd7eea2..8af5f29b65 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -5,7 +5,7 @@ A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors). - You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. + You can also create a color from standardized color names by using [code]ColorN[/code] ([b]FIXME:[/b] No longer true, a Color(String) constructor should be re-implemented for that) or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8]. [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code]. [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url] @@ -158,7 +158,7 @@ - Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. + Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index c3db716d3a..533748aced 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -213,17 +213,6 @@ Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is [code]null[/code] or invalid, the override is cleared and the icon from assigned [Theme] is used. - - - - - - - - - Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is [code]null[/code] or invalid, the override is cleared and the shader from assigned [Theme] is used. - - @@ -417,20 +406,20 @@ Returns the position and size of the control relative to the top-left corner of the screen. See [member rect_position] and [member rect_size]. - - + + - - - Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top]. + Returns the minimum size for this control. See [member rect_min_size]. - - + + + + - Returns the minimum size for this control. See [member rect_min_size]. + Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top]. @@ -685,15 +674,6 @@ Returns [code]true[/code] if icon with given [code]name[/code] has a valid override in this [Control] node. - - - - - - - Returns [code]true[/code] if [Shader] with given [code]name[/code] has a valid override in this [Control] node. - - @@ -1063,6 +1043,13 @@ Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). + + The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. + [b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system. + + + Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does. + Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. @@ -1079,13 +1066,6 @@ Distance between the node's top edge and its parent control, based on [member anchor_top]. Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. - - The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. - [b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system. - - - Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does. - Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If [code]true[/code], parts of a child which would be visibly outside of this control's rectangle will not be rendered. diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 2ca705cec7..d3fcbc9f64 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -215,13 +215,6 @@ Creates a copy of the dictionary, and returns it. The [code]deep[/code] parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects. - - - - - Returns [code]true[/code] if the dictionary is empty. - - @@ -299,6 +292,13 @@ [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash. + + + + + Returns [code]true[/code] if the dictionary is empty. + + diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 5a61c05cee..b01af71852 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -40,13 +40,6 @@ Returns the edited (current) scene's root [Node]. - - - - - Returns the editor's [EditorSettings] instance. - - @@ -55,6 +48,13 @@ [b]Note:[/b] This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically. + + + + + Returns the editor's [EditorSettings] instance. + + diff --git a/doc/classes/EditorSceneImporterAssimp.xml b/doc/classes/EditorSceneImporterAssimp.xml deleted file mode 100644 index c72d4ee25a..0000000000 --- a/doc/classes/EditorSceneImporterAssimp.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - FBX 3D asset importer based on [url=http://assimp.org/]Assimp[/url]. - - - This is an FBX 3D asset importer based on [url=http://assimp.org/]Assimp[/url]. It currently has many known limitations and works best with static meshes. Most animated meshes won't import correctly. - If exporting a FBX scene from Autodesk Maya, use these FBX export settings: - [codeblock] - - Smoothing Groups - - Smooth Mesh - - Triangluate (for meshes with blend shapes) - - Bake Animation - - Resample All - - Deformed Models - - Skins - - Blend Shapes - - Curve Filters - - Constant Key Reducer - - Auto Tangents Only - - *Do not check* Constraints (as it will break the file) - - Can check Embed Media (embeds textures into the exported FBX file) - - Note that when importing embedded media, the texture and mesh will be a single immutable file. - - You will have to re-export then re-import the FBX if the texture has changed. - - Units: Centimeters - - Up Axis: Y - - Binary format in FBX 2017 - [/codeblock] - - - - - - - - diff --git a/doc/classes/EditorSceneImporterGLTF.xml b/doc/classes/EditorSceneImporterGLTF.xml new file mode 100644 index 0000000000..e717b30f73 --- /dev/null +++ b/doc/classes/EditorSceneImporterGLTF.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml new file mode 100644 index 0000000000..1c903bd889 --- /dev/null +++ b/doc/classes/EditorSceneImporterMesh.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/EditorSceneImporterMeshNode3D.xml b/doc/classes/EditorSceneImporterMeshNode3D.xml new file mode 100644 index 0000000000..1e459c1cee --- /dev/null +++ b/doc/classes/EditorSceneImporterMeshNode3D.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/EncodedObjectAsID.xml b/doc/classes/EncodedObjectAsID.xml index fc68b47645..1e4fde453b 100644 --- a/doc/classes/EncodedObjectAsID.xml +++ b/doc/classes/EncodedObjectAsID.xml @@ -4,7 +4,7 @@ Holds a reference to an [Object]'s instance ID. - Utility class which holds a reference to the internal identifier of an [Object] instance, as given by [method Object.get_instance_id]. This ID can then be used to retrieve the object instance with [method @GDScript.instance_from_id]. + Utility class which holds a reference to the internal identifier of an [Object] instance, as given by [method Object.get_instance_id]. This ID can then be used to retrieve the object instance with [method @GlobalScope.instance_from_id]. This class is used internally by the editor inspector and script debugger, but can also be used in plugins to pass and display objects as their IDs. @@ -13,7 +13,7 @@ - The [Object] identifier stored in this [EncodedObjectAsID] instance. The object instance can be retrieved with [method @GDScript.instance_from_id]. + The [Object] identifier stored in this [EncodedObjectAsID] instance. The object instance can be retrieved with [method @GlobalScope.instance_from_id]. diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index c079085fb3..02b81ee9b7 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -51,13 +51,6 @@ Returns the frames per second of the running game. - - - - - Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn]. - - @@ -93,6 +86,13 @@ Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. + + + + + Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn]. + + diff --git a/doc/classes/GLTFAccessor.xml b/doc/classes/GLTFAccessor.xml new file mode 100644 index 0000000000..a1f596f7dd --- /dev/null +++ b/doc/classes/GLTFAccessor.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFAnimation.xml b/doc/classes/GLTFAnimation.xml new file mode 100644 index 0000000000..5c1fa02f11 --- /dev/null +++ b/doc/classes/GLTFAnimation.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFBufferView.xml b/doc/classes/GLTFBufferView.xml new file mode 100644 index 0000000000..edaad85e0a --- /dev/null +++ b/doc/classes/GLTFBufferView.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFCamera.xml b/doc/classes/GLTFCamera.xml new file mode 100644 index 0000000000..0b95f2c802 --- /dev/null +++ b/doc/classes/GLTFCamera.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFDocument.xml b/doc/classes/GLTFDocument.xml new file mode 100644 index 0000000000..04c40dd752 --- /dev/null +++ b/doc/classes/GLTFDocument.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/doc/classes/GLTFLight.xml b/doc/classes/GLTFLight.xml new file mode 100644 index 0000000000..bfeaf9a86e --- /dev/null +++ b/doc/classes/GLTFLight.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFMesh.xml b/doc/classes/GLTFMesh.xml new file mode 100644 index 0000000000..55f79d2c55 --- /dev/null +++ b/doc/classes/GLTFMesh.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFNode.xml b/doc/classes/GLTFNode.xml new file mode 100644 index 0000000000..5b7d4fadec --- /dev/null +++ b/doc/classes/GLTFNode.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFSkeleton.xml b/doc/classes/GLTFSkeleton.xml new file mode 100644 index 0000000000..e27c838648 --- /dev/null +++ b/doc/classes/GLTFSkeleton.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFSkin.xml b/doc/classes/GLTFSkin.xml new file mode 100644 index 0000000000..5a80c7097a --- /dev/null +++ b/doc/classes/GLTFSkin.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFSpecGloss.xml b/doc/classes/GLTFSpecGloss.xml new file mode 100644 index 0000000000..68cc7c845d --- /dev/null +++ b/doc/classes/GLTFSpecGloss.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFState.xml b/doc/classes/GLTFState.xml new file mode 100644 index 0000000000..f7763efdb1 --- /dev/null +++ b/doc/classes/GLTFState.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GLTFTexture.xml b/doc/classes/GLTFTexture.xml new file mode 100644 index 0000000000..c7f94ab0da --- /dev/null +++ b/doc/classes/GLTFTexture.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index cc85ce295b..631a30abab 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -48,6 +48,8 @@ + + The GeometryInstance3D's max LOD distance. [b]Note:[/b] This property currently has no effect. diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 2347627c31..10afa4c339 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -281,17 +281,17 @@ Emitted at the end of a GraphNode movement. - + - Emitted when a GraphNode is selected. - + + Emitted when a GraphNode is selected. diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 8542cdaca4..6e5ff83a35 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -52,6 +52,22 @@ Removes all OpenType features from the item's text. + + + + + + + Ensures the item associated with the specified index is not selected. + + + + + + + Ensures there are no items selected. + + @@ -471,22 +487,6 @@ Sorts items in the list by their text. - - - - - - - Ensures the item associated with the specified index is not selected. - - - - - - - Ensures there are no items selected. - - diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml index 991ebcd7a0..bc94f74b07 100644 --- a/doc/classes/JSONParseResult.xml +++ b/doc/classes/JSONParseResult.xml @@ -21,7 +21,7 @@ The error message if the JSON source was not successfully parsed. See the [enum Error] constants. - A [Variant] containing the parsed JSON. Use [method @GDScript.typeof] or the [code]is[/code] keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ([code]{}[/code]), a [Dictionary] will be returned. If the JSON source starts with brackets ([code][][/code]), an [Array] will be returned. + A [Variant] containing the parsed JSON. Use [method @GlobalScope.typeof] or the [code]is[/code] keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ([code]{}[/code]), a [Dictionary] will be returned. If the JSON source starts with brackets ([code][][/code]), an [Array] will be returned. [b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, parsing a JSON text will convert all numerical values to [float] types. [b]Note:[/b] JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: [codeblocks] diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index 7682379b64..9e976babcf 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -19,7 +19,7 @@ print("Initialized:") print(" Starting time: %s" % str(time_elapsed)) - func _idle(delta): + func _process(delta): time_elapsed += delta # Return true to end the main loop. return quit @@ -51,16 +51,6 @@ Called before the program exits. - - - - - - - Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to [method Node._process]. - If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. - - @@ -68,7 +58,7 @@ Called once during initialization. - + @@ -78,6 +68,16 @@ If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. + + + + + + + Called each process (idle) frame with the time since the last process frame as argument (in seconds). Equivalent to [method Node._process]. + If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. + + diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index dff4b4f7ab..ed7c39d4d9 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -242,5 +242,11 @@ + + Blend shapes are normalized. + + + Blend shapes are relative to base weight. + diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index f4b9d75e91..d6de0ef4cf 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -12,7 +12,7 @@ - + Returns the size of the margin on the specified [enum Side]. @@ -21,7 +21,7 @@ - + diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index f6ff514474..fe3a9c5d39 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -6,7 +6,7 @@ Most basic 3D game object, with a 3D [Transform] and visibility settings. All other 3D game objects inherit from Node3D. Use [Node3D] as a parent node to move, scale, rotate and show/hide children in a 3D project. Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the [Node3D] object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the [Node3D]'s transform. The word local below refers to this coordinate system. The coordinate system that is attached to the [Node3D] object itself is referred to as object-local coordinate system. - [b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad]. + [b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GlobalScope.deg2rad]. https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 50d91c7943..6ff7e34194 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -242,7 +242,7 @@ Returns the object's unique instance ID. - This ID can be saved in [EncodedObjectAsID], and can be used to retrieve the object instance with [method @GDScript.instance_from_id]. + This ID can be saved in [EncodedObjectAsID], and can be used to retrieve the object instance with [method @GlobalScope.instance_from_id]. diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index b00c59ade9..75fb7c1465 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -92,13 +92,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -171,6 +164,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index d6cd5196e4..48d5822f7c 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -59,13 +59,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -93,6 +86,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 52f6ece158..6598828089 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -60,13 +60,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -94,6 +87,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 2f317d4b8c..d116c6756b 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -60,13 +60,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -94,6 +87,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index bda902b15f..2ac7a67b4b 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -60,13 +60,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -94,6 +87,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 9c52ec808b..a7b6bf0a0f 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -60,13 +60,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -94,6 +87,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedSceneGLTF.xml b/doc/classes/PackedSceneGLTF.xml new file mode 100644 index 0000000000..a04c6ef0b6 --- /dev/null +++ b/doc/classes/PackedSceneGLTF.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 24406c53d4..fb7ed2a906 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -60,13 +60,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -94,6 +87,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 2f583e2b9b..eb364ddb18 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -60,13 +60,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -94,6 +87,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 6004454dc9..08ce187b5c 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -59,13 +59,6 @@ Creates a copy of the array, and returns it. - - - - - Returns [code]true[/code] if the array is empty. - - @@ -93,6 +86,13 @@ Reverses the order of the elements in the array. + + + + + Returns [code]true[/code] if the array is empty. + + diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index e3242512c4..ed96f753c2 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -142,7 +142,7 @@ - Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. + Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index d623b0432f..ec380ddc54 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1153,6 +1153,12 @@ Lower-end override for [member rendering/quality/intended_usage/framebuffer_allocation] on mobile devices, due to performance concerns or driver support. + + + + + + Number of cubemaps to store in the reflection atlas. The number of [ReflectionProbe]s in a scene will be limited by this amount. A higher number requires more VRAM. @@ -1281,6 +1287,8 @@ + + Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 425e82c744..ef83ae7fb9 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -127,7 +127,7 @@ - Returns [code]true[/code] if this quaterion and [code]quat[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. + Returns [code]true[/code] if this quaterion and [code]quat[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 3d2852f393..5d7ff39587 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -72,16 +72,6 @@ Returns a [Rect2] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive. - - - - - - - Returns the intersection of this [Rect2] and [code]b[/code]. - If the rectangles do not intersect, an empty [Rect2] is returned. - - @@ -134,7 +124,7 @@ - + @@ -158,6 +148,16 @@ Returns [code]true[/code] if the [Rect2] contains a point. + + + + + + + Returns the intersection of this [Rect2] and [code]b[/code]. + If the rectangles do not intersect, an empty [Rect2] is returned. + + diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 66e5dae78a..e581ccdb11 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -70,16 +70,6 @@ Returns a [Rect2i] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive. - - - - - - - Returns the intersection of this [Rect2i] and [code]b[/code]. - If the rectangles do not intersect, an empty [Rect2i] is returned. - - @@ -132,7 +122,7 @@ - + @@ -156,6 +146,16 @@ Returns [code]true[/code] if the [Rect2i] contains a point. + + + + + + + Returns the intersection of this [Rect2i] and [code]b[/code]. + If the rectangles do not intersect, an empty [Rect2i] is returned. + + diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index 5458b496da..cd08778c89 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -37,6 +37,8 @@ If [code]true[/code], reflections will ignore sky contribution. + + Sets the max distance away from the probe an object can be before it is culled. diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 7e5df9c40d..7cdc9ffaca 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -730,6 +730,8 @@ + + diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 036b50f0ed..4be97b7d3d 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -859,6 +859,12 @@ Tries to free an object in the RenderingServer. + + + + + + @@ -1354,7 +1360,7 @@ - Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. @@ -1366,7 +1372,7 @@ - Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. @@ -1380,7 +1386,7 @@ - Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. @@ -2715,6 +2721,22 @@ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + + + + + + + + + + + + + + + + @@ -2852,6 +2874,16 @@ Currently unimplemented in Godot 3.x. + + + + + + + + + + diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index 5fc1d0b895..2c99815abf 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -260,7 +260,7 @@ The default [MultiplayerAPI] instance for this [SceneTree]. - If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal idle_frame]. + If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame]. If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads. @@ -298,11 +298,6 @@ Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. - - - Emitted immediately before [method Node._process] is called on every node in the [SceneTree]. - - @@ -350,6 +345,11 @@ Emitted immediately before [method Node._physics_process] is called on every node in the [SceneTree]. + + + Emitted immediately before [method Node._process] is called on every node in the [SceneTree]. + + Emitted whenever this [SceneTree]'s [member network_peer] disconnected from server. Only emitted on clients. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index cbaf1196e3..79f21a0e70 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -135,13 +135,6 @@ Returns a copy of the string with indentation (leading tabs and spaces) removed. - - - - - Returns [code]true[/code] if the length of the string equals [code]0[/code]. - - @@ -276,6 +269,13 @@ If the string is a path to a file or directory, returns [code]true[/code] if the path is absolute. + + + + + Returns [code]true[/code] if the length of the string equals [code]0[/code]. + + diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index 525dba0549..a01dfbd4b8 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -39,7 +39,7 @@ - + Returns the default margin of the specified [enum Side]. @@ -48,7 +48,7 @@ - + Returns the content margin offset for the specified [enum Side]. @@ -72,7 +72,7 @@ - + diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 71f227dfb0..13ea7df294 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -27,7 +27,7 @@ - + Returns the specified [enum Side]'s border width. @@ -52,7 +52,7 @@ - + Returns the size of the specified [enum Side]'s expand margin. @@ -61,7 +61,7 @@ - + @@ -116,7 +116,7 @@ - + diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index 5b17f25978..895d0c357d 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -12,7 +12,7 @@ - + Returns the expand margin size of the specified [enum Side]. @@ -21,7 +21,7 @@ - + Returns the margin size of the specified [enum Side]. @@ -54,7 +54,7 @@ - + @@ -65,7 +65,7 @@ - + diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 82ffe86251..e10b65e309 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -31,15 +31,6 @@ Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices. - - - - - - - Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation. - - @@ -148,6 +139,16 @@ Removes the index array by expanding the vertex array. + + + + + + + + + + @@ -173,6 +174,12 @@ + + + + + + @@ -186,6 +193,12 @@ Shrinks the vertex array by creating an index array (avoids reusing vertices). + + + + + + @@ -251,6 +264,15 @@ + + + + + + + Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation. + + diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index c9ed1aaec9..10cdd0eade 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -137,6 +137,9 @@ + + If [code]true[/code], all tabs are drawn in front of the panel. If [code]false[/code], inactive tabs are drawn behind the panel. + The current tab index. When set, this index's [Control] node's [code]visible[/code] property is set to [code]true[/code] and all others are set to [code]false[/code]. @@ -149,9 +152,6 @@ If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden. - - If [code]true[/code], all tabs are drawn in front of the panel. If [code]false[/code], inactive tabs are drawn behind the panel. - If [code]true[/code], children [Control] nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one. diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index cfc8f16648..b40759578f 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -12,7 +12,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index cd76689ffe..775bd58bcf 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -17,7 +17,7 @@ - VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time. - C# is statically typed, but uses the Mono [code]object[/code] type in place of Godot's Variant class when it needs to represent a dynamic value. [code]object[/code] is the Mono runtime's equivalent of the same concept. - The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects. - The global [method @GDScript.typeof] function returns the enumerated value of the Variant type stored in the current variable (see [enum Variant.Type]). + The global [method @GlobalScope.typeof] function returns the enumerated value of the Variant type stored in the current variable (see [enum Variant.Type]). [codeblock] var foo = 2 match typeof(foo): diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index fef2d7cedd..4159a38d96 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -66,7 +66,7 @@ Returns this vector's angle with respect to the positive X axis, or [code](1, 0)[/code] vector, in radians. For example, [code]Vector2.RIGHT.angle()[/code] will return zero, [code]Vector2.DOWN.angle()[/code] will return [code]PI / 2[/code] (a quarter turn, or 90 degrees), and [code]Vector2(1, -1).angle()[/code] will return [code]-PI / 4[/code] (a negative eighth turn, or -45 degrees). - Equivalent to the result of [method @GDScript.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code]. + Equivalent to the result of [method @GlobalScope.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code]. @@ -196,7 +196,7 @@ - Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. + Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. @@ -390,13 +390,20 @@ + + + + + Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. + + - Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]mod[/code]. + Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [code]mod[/code]. @@ -405,7 +412,7 @@ - Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]modv[/code]'s components. + Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [code]modv[/code]'s components. @@ -432,7 +439,7 @@ - Returns the vector rotated by [code]phi[/code] radians. See also [method @GDScript.deg2rad]. + Returns the vector rotated by [code]phi[/code] radians. See also [method @GlobalScope.deg2rad]. @@ -446,7 +453,7 @@ - Returns the vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GDScript.sign] on each component. + Returns the vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component. @@ -479,13 +486,6 @@ Returns this vector with each component snapped to the nearest multiple of [code]step[/code]. This can also be used to round to an arbitrary number of decimals. - - - - - Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. - - diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 46fd45f85f..2d129a2c86 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -171,7 +171,7 @@ - Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component. + Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. @@ -410,7 +410,7 @@ - Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]mod[/code]. + Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [code]mod[/code]. @@ -419,7 +419,7 @@ - Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]modv[/code]'s components. + Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [code]modv[/code]'s components. @@ -462,7 +462,7 @@ - Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling [method @GDScript.sign] on each component. + Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 7b513d56c3..e66b8353a8 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -222,6 +222,8 @@ + + The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 4 is best unless targeting very high-end systems. @@ -405,6 +407,8 @@ + + The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. diff --git a/doc/classes/WeakRef.xml b/doc/classes/WeakRef.xml index 07d82289a3..4140df5828 100644 --- a/doc/classes/WeakRef.xml +++ b/doc/classes/WeakRef.xml @@ -4,7 +4,7 @@ Holds an [Object], but does not contribute to the reference count if the object is a reference. - A weakref can hold a [Reference], without contributing to the reference counter. A weakref can be created from an [Object] using [method @GDScript.weakref]. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. + A weakref can hold a [Reference], without contributing to the reference counter. A weakref can be created from an [Object] using [method @GlobalScope.weakref]. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml index 345e5efdee..a4a86cc22a 100644 --- a/doc/classes/XRController3D.xml +++ b/doc/classes/XRController3D.xml @@ -19,13 +19,6 @@ If active, returns the name of the associated controller if provided by the AR/VR SDK used. - - - - - Returns the hand holding this controller, if known. See [enum XRPositionalTracker.TrackerHand]. - - @@ -56,6 +49,13 @@ If provided by the [XRInterface], this returns a mesh associated with the controller. This can be used to visualize the controller. + + + + + Returns the hand holding this controller, if known. See [enum XRPositionalTracker.TrackerHand]. + + diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml index 36ff312e4d..36cd6e2ea0 100644 --- a/doc/classes/XRPositionalTracker.xml +++ b/doc/classes/XRPositionalTracker.xml @@ -12,13 +12,6 @@ https://docs.godotengine.org/en/latest/tutorials/vr/index.html - - - - - Returns the hand holding this tracker, if known. See [enum TrackerHand] constants. - - @@ -47,6 +40,13 @@ Returns the world-space controller position. + + + + + Returns the hand holding this tracker, if known. See [enum TrackerHand] constants. + + @@ -68,6 +68,15 @@ Returns the tracker's type, which will be one of the values from the [enum XRServer.TrackerType] enum. + + + + + + + Returns the transform combining this device's orientation and position. + + @@ -82,15 +91,6 @@ Returns [code]true[/code] if this device is tracking position. - - - - - - - Returns the transform combining this device's orientation and position. - - diff --git a/modules/fbx/doc_classes/EditorSceneImporterFBX.xml b/modules/fbx/doc_classes/EditorSceneImporterFBX.xml index 72b6e0f5fd..da1a68c27c 100644 --- a/modules/fbx/doc_classes/EditorSceneImporterFBX.xml +++ b/modules/fbx/doc_classes/EditorSceneImporterFBX.xml @@ -1,5 +1,5 @@ - + FBX 3D asset importer. diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index d60ed8c60c..9e974b6fdc 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -32,59 +32,6 @@ [/codeblock] - - - - - - - - - Returns a color according to the standardized [code]name[/code] with [code]alpha[/code] ranging from 0 to 1. - [codeblock] - red = ColorN("red", 1) - [/codeblock] - Supported color names are the same as the constants defined in [Color]. - - - - - - - - - Returns the absolute value of parameter [code]s[/code] (i.e. positive value). - [codeblock] - a = abs(-1) # a is 1 - [/codeblock] - - - - - - - - - Returns the arc cosine of [code]s[/code] in radians. Use to get the angle of cosine [code]s[/code]. - [codeblock] - # c is 0.523599 or 30 degrees if converted with rad2deg(s) - c = acos(0.866025) - [/codeblock] - - - - - - - - - Returns the arc sine of [code]s[/code] in radians. Use to get the angle of sine [code]s[/code]. - [codeblock] - # s is 0.523599 or 30 degrees if converted with rad2deg(s) - s = asin(0.5) - [/codeblock] - - @@ -93,7 +40,7 @@ - Asserts that the [code]condition[/code] is [code]true[/code]. If the [code]condition[/code] is [code]false[/code], an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of [method push_error] for reporting errors to project developers or add-on users. + Asserts that the [code]condition[/code] is [code]true[/code]. If the [code]condition[/code] is [code]false[/code], an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of [method @GlobalScope.push_error] for reporting errors to project developers or add-on users. [b]Note:[/b] For performance reasons, the code inside [method assert] is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an [method assert] call. Otherwise, the project will behave differently when exported in release mode. The optional [code]message[/code] argument, if given, is shown in addition to the generic "Assertion failed" message. You can use this to provide additional details about why the assertion failed. [codeblock] @@ -106,75 +53,10 @@ [/codeblock] - - - - - - - Returns the arc tangent of [code]s[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry: [code]atan(tan(angle)) == angle[/code]. - The method cannot know in which quadrant the angle should fall. See [method atan2] if you have both [code]y[/code] and [code]x[/code]. - [codeblock] - a = atan(0.5) # a is 0.463648 - [/codeblock] - - - - - - - - - - - Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. - Important note: The Y coordinate comes first, by convention. - [codeblock] - a = atan2(0, -1) # a is 3.141593 - [/codeblock] - - - - - - - - - - - Decodes a byte array back to a value. When [code]allow_objects[/code] is [code]true[/code] decoding objects is allowed. - [b]WARNING:[/b] Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution). - - - - - - - - - - - Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). - - - - - - - - - Rounds [code]s[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]s[/code]. - [codeblock] - a = ceil(1.45) # a is 2.0 - a = ceil(1.001) # a is 2.0 - [/codeblock] - See also [method floor], [method round], [method snapped], and [int]. - - - + Returns a character as a String of the given Unicode code point (which is compatible with ASCII code). @@ -183,25 +65,6 @@ a = char(65 + 32) # a is "a" a = char(8364) # a is "€" [/codeblock] - This is the inverse of [method ord]. - - - - - - - - - - - - - Clamps [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code]. - [codeblock] - a = clamp(1000, 1, 20) # a is 20 - a = clamp(-10, 1, 20) # a is 1 - a = clamp(15, 1, 20) # a is 15 - [/codeblock] @@ -223,159 +86,15 @@ [/codeblock] - - - - - - - Returns the cosine of angle [code]s[/code] in radians. - [codeblock] - a = cos(TAU) # a is 1.0 - a = cos(PI) # a is -1.0 - [/codeblock] - - - - - - - - - Returns the hyperbolic cosine of [code]s[/code] in radians. - [codeblock] - print(cosh(1)) # Prints 1.543081 - [/codeblock] - - - - - - - - - Converts from decibels to linear energy (audio). - - - - - - - - - - - - - Returns the result of [code]value[/code] decreased by [code]step[/code] * [code]amount[/code]. - [codeblock] - a = dectime(60, 10, 0.1)) # a is 59.0 - [/codeblock] - - - - - - - - - Converts an angle expressed in degrees to radians. - [codeblock] - r = deg2rad(180) # r is 3.141593 - [/codeblock] - - - + Converts a dictionary (previously created with [method inst2dict]) back to an instance. Useful for deserializing. - - - - - - - - - Easing function, based on exponent. The curve values are: 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. - - - - - - - - - The natural exponential function. It raises the mathematical constant [b]e[/b] to the power of [code]s[/code] and returns it. - [b]e[/b] has an approximate value of 2.71828, and can be obtained with [code]exp(1)[/code]. - For exponents to other bases use the method [method pow]. - [codeblock] - a = exp(2) # Approximately 7.39 - [/codeblock] - - - - - - - - - Rounds [code]s[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]s[/code]. - [codeblock] - a = floor(2.45) # a is 2.0 - a = floor(2.99) # a is 2.0 - a = floor(-2.99) # a is -3.0 - [/codeblock] - See also [method ceil], [method round], [method snapped], and [int]. - [b]Note:[/b] This method returns a float. If you need an integer and [code]s[/code] is a non-negative number, you can use [code]int(s)[/code] directly. - - - - - - - - - - - Returns the floating-point remainder of [code]a/b[/code], keeping the sign of [code]a[/code]. - [codeblock] - r = fmod(7, 5.5) # r is 1.5 - [/codeblock] - For the integer remainder operation, use the % operator. - - - - - - - - - - - Returns the floating-point modulus of [code]a/b[/code] that wraps equally in positive and negative. - [codeblock] - for i in 7: - var x = 0.5 * i - 1.5 - print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) - [/codeblock] - Produces: - [codeblock] - -1.5 -0.0 0.0 - -1.0 -1.0 0.5 - -0.5 -0.5 1.0 - 0.0 0.0 0.0 - 0.5 0.5 0.5 - 1.0 1.0 1.0 - 1.5 0.0 0.0 - [/codeblock] - - @@ -397,22 +116,10 @@ [/codeblock] - - - - - - - Returns the integer hash of the variable passed. - [codeblock] - print(hash("a")) # Prints 177670 - [/codeblock] - - - + Returns the passed instance converted to a dictionary (useful for serializing). @@ -430,92 +137,6 @@ [/codeblock] - - - - - - - Returns the Object that corresponds to [code]instance_id[/code]. All Objects have a unique instance ID. - [codeblock] - var foo = "bar" - func _ready(): - var id = get_instance_id() - var inst = instance_from_id(id) - print(inst.foo) # Prints bar - [/codeblock] - - - - - - - - - - - - - Returns a normalized value considering the given range. This is the opposite of [method lerp]. - [codeblock] - var middle = lerp(20, 30, 0.75) - # `middle` is now 27.5. - # Now, we pretend to have forgotten the original ratio and want to get it back. - var ratio = inverse_lerp(20, 30, 27.5) - # `ratio` is now 0.75. - [/codeblock] - - - - - - - - - - - Returns [code]true[/code] if [code]a[/code] and [code]b[/code] are approximately equal to each other. - Here, approximately equal means that [code]a[/code] and [code]b[/code] are within a small internal epsilon of each other, which scales with the magnitude of the numbers. - Infinity values of the same sign are considered equal. - - - - - - - - - Returns whether [code]s[/code] is an infinity value (either positive infinity or negative infinity). - - - - - - - - - Returns whether [code]instance[/code] is a valid object (e.g. has not been deleted from memory). - - - - - - - - - Returns whether [code]s[/code] is a NaN ("Not a Number" or invalid) value. - - - - - - - - - Returns [code]true[/code] if [code]s[/code] is zero or almost zero. - This method is faster than using [method is_equal_approx] with one value as zero. - - @@ -530,63 +151,6 @@ [/codeblock] - - - - - - - - - - - Linearly interpolates between two values by a normalized value. This is the opposite of [method inverse_lerp]. - If the [code]from[/code] and [code]to[/code] arguments are of type [int] or [float], the return value is a [float]. - If both are of the same vector type ([Vector2], [Vector3] or [Color]), the return value will be of the same type ([code]lerp[/code] then calls the vector type's [code]lerp[/code] method). - [codeblock] - lerp(0, 4, 0.75) # Returns 3.0 - lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5) - [/codeblock] - - - - - - - - - - - - - Linearly interpolates between two angles (in radians) by a normalized value. - Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU]. - [codeblock] - extends Sprite - var elapsed = 0.0 - func _process(delta): - var min_angle = deg2rad(0.0) - var max_angle = deg2rad(90.0) - rotation = lerp_angle(min_angle, max_angle, elapsed) - elapsed += delta - [/codeblock] - - - - - - - - - Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example: - [codeblock] - # "Slider" refers to a node that inherits Range such as HSlider or VSlider. - # Its range must be configured to go from 0 to 1. - # Change the bus name if you'd like to change the volume of a specific bus only. - AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear2db($Slider.value)) - [/codeblock] - - @@ -603,370 +167,40 @@ This method is a simplified version of [method ResourceLoader.load], which can be used for more advanced scenarios. - - + + - + - Natural logarithm. The amount of time needed to reach a certain level of continuous growth. - [b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. + Returns a [Resource] from the filesystem located at [code]path[/code]. The resource is loaded during script parsing, i.e. is loaded with the script and [method preload] effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use [method load]. + [b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. [codeblock] - log(10) # Returns 2.302585 + # Instance a scene. + var diamond = preload("res://diamond.tscn").instance() [/codeblock] - [b]Note:[/b] The logarithm of [code]0[/code] returns [code]-inf[/code], while negative values return [code]-nan[/code]. - - + + - - - - - Returns the maximum of two values. - [codeblock] - max(1, 2) # Returns 2 - max(-3.99, -4) # Returns -3.99 - [/codeblock] + Like [method @GlobalScope.print], but prints only when used in debug mode. - - + + - - - - - Returns the minimum of two values. + Prints a stack track at code location, only works when running with debugger turned on. + Output in the console would look something like this: [codeblock] - min(1, 2) # Returns 1 - min(-3.99, -4) # Returns -4 + Frame 0 - res://test.gd:16 in function '_process' [/codeblock] - - - - - - - - - - - Moves [code]from[/code] toward [code]to[/code] by the [code]delta[/code] value. - Use a negative [code]delta[/code] value to move away. - [codeblock] - move_toward(5, 10, 4) # Returns 9 - move_toward(10, 5, 4) # Returns 6 - move_toward(10, 5, -1.5) # Returns 11.5 - [/codeblock] - - - - - - - - - Returns the nearest equal or larger power of 2 for integer [code]value[/code]. - In other words, returns the smallest value [code]a[/code] where [code]a = pow(2, n)[/code] such that [code]value <= a[/code] for some non-negative integer [code]n[/code]. - [codeblock] - nearest_po2(3) # Returns 4 - nearest_po2(4) # Returns 4 - nearest_po2(5) # Returns 8 - - nearest_po2(0) # Returns 0 (this may not be what you expect) - nearest_po2(-1) # Returns 0 (this may not be what you expect) - [/codeblock] - [b]WARNING:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [code]value[/code] (in reality, 1 is the smallest integer power of 2). - - - - - - - - - Returns an integer representing the Unicode code point of the given Unicode character [code]char[/code]. - [codeblock] - a = ord("A") # a is 65 - a = ord("a") # a is 97 - a = ord("€") # a is 8364 - [/codeblock] - This is the inverse of [method char]. - - - - - - - - - Parse JSON text to a Variant. (Use [method typeof] to check if the Variant's type is what you expect.) - [b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, parsing a JSON text will convert all numerical values to [float] types. - [b]Note:[/b] JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: - [codeblock] - var p = JSON.parse('["hello", "world", "!"]') - if typeof(p.result) == TYPE_ARRAY: - print(p.result[0]) # Prints "hello" - else: - push_error("Unexpected results.") - [/codeblock] - See also [JSON] for an alternative way to parse JSON text. - - - - - - - - - - - Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (X and Y axis). - - - - - - - - - - - Returns the integer modulus of [code]a/b[/code] that wraps equally in positive and negative. - [codeblock] - for i in range(-3, 4): - print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) - [/codeblock] - Produces: - [codeblock] - -3 0 0 - -2 -2 1 - -1 -1 2 - 0 0 0 - 1 1 1 - 2 2 2 - 3 0 0 - [/codeblock] - - - - - - - - - - - Returns the result of [code]base[/code] raised to the power of [code]exp[/code]. - [codeblock] - pow(2, 5) # Returns 32.0 - [/codeblock] - - - - - - - - - Returns a [Resource] from the filesystem located at [code]path[/code]. The resource is loaded during script parsing, i.e. is loaded with the script and [method preload] effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use [method load]. - [b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. - [codeblock] - # Instance a scene. - var diamond = preload("res://diamond.tscn").instance() - [/codeblock] - - - - - - - Converts one or more arguments to strings in the best way possible and prints them to the console. - [codeblock] - a = [1, 2, 3] - print("a", "=", a) # Prints a=[1, 2, 3] - [/codeblock] - [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. - - - - - - - Like [method print], but prints only when used in debug mode. - - - - - - - Prints a stack track at code location, only works when running with debugger turned on. - Output in the console would look something like this: - [codeblock] - Frame 0 - res://test.gd:16 in function '_process' - [/codeblock] - - - - - - - Prints one or more arguments to strings in the best way possible to standard error line. - [codeblock] - printerr("prints to stderr") - [/codeblock] - - - - - - - Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. - [codeblock] - printraw("A") - printraw("B") - # Prints AB - [/codeblock] - [b]Note:[/b] Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as [method print]. - - - - - - - Prints one or more arguments to the console with a space between each argument. - [codeblock] - prints("A", "B", "C") # Prints A B C - [/codeblock] - - - - - - - Prints one or more arguments to the console with a tab between each argument. - [codeblock] - printt("A", "B", "C") # Prints A B C - [/codeblock] - - - - - - - - - Pushes an error message to Godot's built-in debugger and to the OS terminal. - [codeblock] - push_error("test error") # Prints "test error" to debugger and terminal as error call - [/codeblock] - [b]Note:[/b] Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead. - - - - - - - - - Pushes a warning message to Godot's built-in debugger and to the OS terminal. - [codeblock] - push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call - [/codeblock] - - - - - - - - - Converts an angle expressed in radians to degrees. - [codeblock] - rad2deg(0.523599) # Returns 30.0 - [/codeblock] - - - - - - - - - Random from seed: pass a [code]seed[/code], and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits. - - - - - - - Returns a random floating point value on the interval [code][0, 1][/code]. - [codeblock] - randf() # Returns e.g. 0.375671 - [/codeblock] - - - - - - - - - - - Random range, any floating point value between [code]from[/code] and [code]to[/code]. - [codeblock] - prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 - [/codeblock] - - - - - - - Returns a random unsigned 32 bit integer. Use remainder to obtain a random value in the interval [code][0, N - 1][/code] (where N is smaller than 2^32). - [codeblock] - randi() # Returns random integer between 0 and 2^32 - 1 - randi() % 20 # Returns random integer between 0 and 19 - randi() % 100 # Returns random integer between 0 and 99 - randi() % 100 + 1 # Returns random integer between 1 and 100 - [/codeblock] - - - - - - - - - - - Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped. - [codeblock] - print(randi_range(0, 1)) # Prints 0 or 1 - print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 - [/codeblock] - - - - - - - Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. - [codeblock] - func _ready(): - randomize() - [/codeblock] - - - - + + Returns an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment). @@ -983,157 +217,6 @@ [/codeblock] - - - - - - - - - - - - - - - Maps a [code]value[/code] from range [code][istart, istop][/code] to [code][ostart, ostop][/code]. - [codeblock] - range_lerp(75, 0, 100, -1, 1) # Returns 0.5 - [/codeblock] - - - - - - - - - Rounds [code]s[/code] to the nearest whole number, with halfway cases rounded away from zero. - [codeblock] - a = round(2.49) # a is 2.0 - a = round(2.5) # a is 3.0 - a = round(2.51) # a is 3.0 - [/codeblock] - See also [method floor], [method ceil], [method snapped], and [int]. - - - - - - - - - Sets seed for the random number generator. - [codeblock] - my_seed = "Godot Rocks" - seed(my_seed.hash()) - [/codeblock] - - - - - - - - - Returns the sign of [code]s[/code]: -1 or 1. Returns 0 if [code]s[/code] is 0. - [codeblock] - sign(-6) # Returns -1 - sign(0) # Returns 0 - sign(6) # Returns 1 - [/codeblock] - - - - - - - - - Returns the sine of angle [code]s[/code] in radians. - [codeblock] - sin(0.523599) # Returns 0.5 - [/codeblock] - - - - - - - - - Returns the hyperbolic sine of [code]s[/code]. - [codeblock] - a = log(2.0) # Returns 0.693147 - sinh(a) # Returns 0.75 - [/codeblock] - - - - - - - - - - - - - Returns the result of smoothly interpolating the value of [code]s[/code] between [code]0[/code] and [code]1[/code], based on the where [code]s[/code] lies with respect to the edges [code]from[/code] and [code]to[/code]. - The return value is [code]0[/code] if [code]s <= from[/code], and [code]1[/code] if [code]s >= to[/code]. If [code]s[/code] lies between [code]from[/code] and [code]to[/code], the returned value follows an S-shaped curve that maps [code]s[/code] between [code]0[/code] and [code]1[/code]. - This S-shaped curve is the cubic Hermite interpolator, given by [code]f(s) = 3*s^2 - 2*s^3[/code]. - [codeblock] - smoothstep(0, 2, -5.0) # Returns 0.0 - smoothstep(0, 2, 0.5) # Returns 0.15625 - smoothstep(0, 2, 1.0) # Returns 0.5 - smoothstep(0, 2, 2.0) # Returns 1.0 - [/codeblock] - - - - - - - - - Returns the square root of [code]s[/code], where [code]s[/code] is a non-negative number. - [codeblock] - sqrt(9) # Returns 3 - [/codeblock] - [b]Note:[/b]Negative values of [code]s[/code] return NaN. If you need negative inputs, use [code]System.Numerics.Complex[/code] in C#. - - - - - - - - - Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. - [codeblock] - n = step_decimals(5) # n is 0 - n = step_decimals(1.0005) # n is 4 - n = step_decimals(0.000000005) # n is 9 - [/codeblock] - - - - - - - - - - - Snaps float value [code]s[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals. - [codeblock] - snapped(100, 32) # Returns 96.0 - snapped(3.14159, 0.01) # Returns 3.14 - [/codeblock] - See also [method ceil], [method floor], [method round], and [int]. - - @@ -1147,200 +230,12 @@ [/codeblock] - - - - - - - Converts a formatted string that was returned by [method var2str] to the original value. - [codeblock] - a = '{ "a": 1, "b": 2 }' - b = str2var(a) - print(b["a"]) # Prints 1 - [/codeblock] - - - - - - - - - Returns the tangent of angle [code]s[/code] in radians. - [codeblock] - tan(deg2rad(45)) # Returns 1 - [/codeblock] - - - - - - - - - Returns the hyperbolic tangent of [code]s[/code]. - [codeblock] - a = log(2.0) # a is 0.693147 - b = tanh(a) # b is 0.6 - [/codeblock] - - - - - - - - - Converts a [Variant] [code]var[/code] to JSON text and return the result. Useful for serializing data to store or send over the network. - [codeblock] - # Both numbers below are integers. - a = { "a": 1, "b": 2 } - b = to_json(a) - print(b) # {"a":1, "b":2} - # Both numbers above are floats, even if they display without any decimal places. - [/codeblock] - [b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, converting a [Variant] to JSON text will convert all numerical values to [float] types. - See also [JSON] for an alternative way to convert a [Variant] to JSON text. - - - - - - Returns whether the given class exists in [ClassDB]. - [codeblock] - type_exists("Sprite2D") # Returns true - type_exists("Variant") # Returns false - [/codeblock] - - - - - - - - - Returns the internal type of the given Variant object, using the [enum Variant.Type] values. - [codeblock] - p = parse_json('["a", "b", "c"]') - if typeof(p) == TYPE_ARRAY: - print(p[0]) # Prints a - else: - print("unexpected results") - [/codeblock] - - - - - - - - - Checks that [code]json[/code] is valid JSON data. Returns an empty string if valid, or an error message otherwise. - [codeblock] - j = to_json([1, 2, 3]) - v = validate_json(j) - if not v: - print("Valid JSON.") - else: - push_error("Invalid JSON: " + v) - [/codeblock] - - - - - - - - - - - Encodes a variable value to a byte array. When [code]full_objects[/code] is [code]true[/code] encoding objects is allowed (and can potentially include code). - - - - - - - - - Converts a Variant [code]var[/code] to a formatted string that can later be parsed using [method str2var]. - [codeblock] - a = { "a": 1, "b": 2 } - print(var2str(a)) - [/codeblock] - prints - [codeblock] - { - "a": 1, - "b": 2 - } - [/codeblock] - - - - - - - - - Returns a weak reference to an object. - A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it. - - - - - - - - - - + - Wraps float [code]value[/code] between [code]min[/code] and [code]max[/code]. - Usable for creating loop-alike behavior or infinite surfaces. - [codeblock] - # Infinite loop between 5.0 and 9.9 - value = wrapf(value + 0.1, 5.0, 10.0) - [/codeblock] - [codeblock] - # Infinite rotation (in radians) - angle = wrapf(angle + 0.1, 0.0, TAU) - [/codeblock] - [codeblock] - # Infinite rotation (in radians) - angle = wrapf(angle + 0.1, -PI, PI) - [/codeblock] - [b]Note:[/b] If [code]min[/code] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead. - [code]wrapf[/code] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value. - - - - - - - - - - - - - Wraps integer [code]value[/code] between [code]min[/code] and [code]max[/code]. - Usable for creating loop-alike behavior or infinite surfaces. - [codeblock] - # Infinite loop between 5 and 9 - frame = wrapi(frame + 1, 5, 10) - [/codeblock] - [codeblock] - # result is -2 - var result = wrapi(-6, -5, -1) - [/codeblock] - [b]Note:[/b] If [code]min[/code] is [code]0[/code], this is equivalent to [method posmod], so prefer using that instead. - [code]wrapi[/code] is more flexible than using the [method posmod] approach by giving the user control over the minimum value. diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index 000fbd0140..4004f1a04c 100644 --- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -92,7 +92,7 @@ Return the number of digit places after the decimal that the first non-zero digit occurs. - + Return the input snapped to a given step. -- cgit v1.2.3