diff options
Diffstat (limited to 'doc/classes')
103 files changed, 1379 insertions, 624 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 41cc043a74..7f794fef6e 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -358,14 +358,16 @@ <argument index="1" name="to" type="float" /> <argument index="2" name="weight" type="float" /> <description> - Returns a normalized value considering the given range. This is the opposite of [method lerp]. + Returns an interpolation or extrapolation factor considering the range specified in [code]from[/code] and [code]to[/code], and the interpolated value specified in [code]weight[/code]. The returned value will be between [code]0.0[/code] and [code]1.0[/code] if [code]weight[/code] is between [code]from[/code] and [code]to[/code] (inclusive). If [code]weight[/code] is located outside this range, then an extrapolation factor will be returned (return value lower than [code]0.0[/code] or greater than [code]1.0[/code]). [codeblock] + # The interpolation ratio in the `lerp()` call below is 0.75. 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] + See also [method lerp] which performs the reverse of this operation. </description> </method> <method name="is_equal_approx"> @@ -420,10 +422,11 @@ <argument index="1" name="to" type="float" /> <argument index="2" name="weight" type="float" /> <description> - Linearly interpolates between two values by a normalized value. This is the opposite of [method inverse_lerp]. + Linearly interpolates between two values by the factor defined in [code]weight[/code]. To perform interpolation, [code]weight[/code] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. [codeblock] lerp(0, 4, 0.75) # Returns 3.0 [/codeblock] + See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep]. </description> </method> <method name="lerp_angle"> @@ -433,7 +436,7 @@ <argument index="2" name="weight" type="float" /> <description> 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]. + Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU]. To perform eased interpolation with [method lerp_angle], combine it with [method ease] or [method smoothstep]. [codeblock] extends Sprite var elapsed = 0.0 @@ -1210,56 +1213,59 @@ </constant> <constant name="COUNTERCLOCKWISE" value="1" enum="ClockDirection"> </constant> - <constant name="HALIGN_LEFT" value="0" enum="HAlign"> + <constant name="HORIZONTAL_ALIGNMENT_LEFT" value="0" enum="HorizontalAlignment"> Horizontal left alignment, usually for text-derived classes. </constant> - <constant name="HALIGN_CENTER" value="1" enum="HAlign"> + <constant name="HORIZONTAL_ALIGNMENT_CENTER" value="1" enum="HorizontalAlignment"> Horizontal center alignment, usually for text-derived classes. </constant> - <constant name="HALIGN_RIGHT" value="2" enum="HAlign"> + <constant name="HORIZONTAL_ALIGNMENT_RIGHT" value="2" enum="HorizontalAlignment"> Horizontal right alignment, usually for text-derived classes. </constant> - <constant name="HALIGN_FILL" value="3" enum="HAlign"> + <constant name="HORIZONTAL_ALIGNMENT_FILL" value="3" enum="HorizontalAlignment"> Expand row to fit width, usually for text-derived classes. </constant> - <constant name="VALIGN_TOP" value="0" enum="VAlign"> + <constant name="VERTICAL_ALIGNMENT_TOP" value="0" enum="VerticalAlignment"> Vertical top alignment, usually for text-derived classes. </constant> - <constant name="VALIGN_CENTER" value="1" enum="VAlign"> + <constant name="VERTICAL_ALIGNMENT_CENTER" value="1" enum="VerticalAlignment"> Vertical center alignment, usually for text-derived classes. </constant> - <constant name="VALIGN_BOTTOM" value="2" enum="VAlign"> + <constant name="VERTICAL_ALIGNMENT_BOTTOM" value="2" enum="VerticalAlignment"> Vertical bottom alignment, usually for text-derived classes. </constant> - <constant name="INLINE_ALIGN_TOP_TO" value="0" enum="InlineAlign"> - Aligns the top of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGN_TO_*[/code] constant. + <constant name="VERTICAL_ALIGNMENT_FILL" value="3" enum="VerticalAlignment"> + Expand rows to fit height, usually for text-derived classes. </constant> - <constant name="INLINE_ALIGN_CENTER_TO" value="1" enum="InlineAlign"> - Aligns the center of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGN_TO_*[/code] constant. + <constant name="INLINE_ALIGNMENT_TOP_TO" value="0" enum="InlineAlignment"> + Aligns the top of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant. </constant> - <constant name="INLINE_ALIGN_BOTTOM_TO" value="2" enum="InlineAlign"> - Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGN_TO_*[/code] constant. + <constant name="INLINE_ALIGNMENT_CENTER_TO" value="1" enum="InlineAlignment"> + Aligns the center of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant. </constant> - <constant name="INLINE_ALIGN_TO_TOP" value="0" enum="InlineAlign"> - Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGN_*_TO[/code] constant to the top of the text. + <constant name="INLINE_ALIGNMENT_BOTTOM_TO" value="2" enum="InlineAlignment"> + Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant. </constant> - <constant name="INLINE_ALIGN_TO_CENTER" value="4" enum="InlineAlign"> - Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGN_*_TO[/code] constant to the center of the text. + <constant name="INLINE_ALIGNMENT_TO_TOP" value="0" enum="InlineAlignment"> + Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the top of the text. </constant> - <constant name="INLINE_ALIGN_TO_BASELINE" value="8" enum="InlineAlign"> - Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGN_*_TO[/code] constant to the baseline of the text. + <constant name="INLINE_ALIGNMENT_TO_CENTER" value="4" enum="InlineAlignment"> + Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the center of the text. </constant> - <constant name="INLINE_ALIGN_TO_BOTTOM" value="12" enum="InlineAlign"> + <constant name="INLINE_ALIGNMENT_TO_BASELINE" value="8" enum="InlineAlignment"> + Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the baseline of the text. + </constant> + <constant name="INLINE_ALIGNMENT_TO_BOTTOM" value="12" enum="InlineAlignment"> Aligns inline object (e.g. image, table) to the bottom of the text. </constant> - <constant name="INLINE_ALIGN_TOP" value="0" enum="InlineAlign"> - Aligns top of the inline object (e.g. image, table) to the top of the text. Equvalent to [code]INLINE_ALIGN_TOP_TO | INLINE_ALIGN_TO_TOP[/code]. + <constant name="INLINE_ALIGNMENT_TOP" value="0" enum="InlineAlignment"> + Aligns top of the inline object (e.g. image, table) to the top of the text. Equivalent to [code]INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP[/code]. </constant> - <constant name="INLINE_ALIGN_CENTER" value="5" enum="InlineAlign"> - Aligns center of the inline object (e.g. image, table) to the center of the text. Equvalent to [code]INLINE_ALIGN_CENTER_TO | INLINE_ALIGN_TO_CENTER[/code]. + <constant name="INLINE_ALIGNMENT_CENTER" value="5" enum="InlineAlignment"> + Aligns center of the inline object (e.g. image, table) to the center of the text. Equivalent to [code]INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER[/code]. </constant> - <constant name="INLINE_ALIGN_BOTTOM" value="14" enum="InlineAlign"> - Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equvalent to [code]INLINE_ALIGN_BOTTOM_TO | INLINE_ALIGN_TO_BOTTOM[/code]. + <constant name="INLINE_ALIGNMENT_BOTTOM" value="14" enum="InlineAlignment"> + Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to [code]INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM[/code]. </constant> <constant name="KEY_SPECIAL" value="16777216" enum="Key"> Keycodes with this bit applied are non-printable. @@ -2159,25 +2165,58 @@ The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes. </constant> <constant name="MIDI_MESSAGE_NOTE_OFF" value="8" enum="MIDIMessage"> - MIDI note OFF message. + MIDI note OFF message. See the documentation of [InputEventMIDI] for information of how to use MIDI inputs. </constant> <constant name="MIDI_MESSAGE_NOTE_ON" value="9" enum="MIDIMessage"> - MIDI note ON message. + MIDI note ON message. See the documentation of [InputEventMIDI] for information of how to use MIDI inputs. </constant> <constant name="MIDI_MESSAGE_AFTERTOUCH" value="10" enum="MIDIMessage"> - MIDI aftertouch message. + MIDI aftertouch message. This message is most often sent by pressing down on the key after it "bottoms out". </constant> <constant name="MIDI_MESSAGE_CONTROL_CHANGE" value="11" enum="MIDIMessage"> - MIDI control change message. + MIDI control change message. This message is sent when a controller value changes. Controllers include devices such as pedals and levers. </constant> <constant name="MIDI_MESSAGE_PROGRAM_CHANGE" value="12" enum="MIDIMessage"> - MIDI program change message. + MIDI program change message. This message sent when the program patch number changes. </constant> <constant name="MIDI_MESSAGE_CHANNEL_PRESSURE" value="13" enum="MIDIMessage"> - MIDI channel pressure message. + MIDI channel pressure message. This message is most often sent by pressing down on the key after it "bottoms out". This message is different from polyphonic after-touch as it indicates the highest pressure across all keys. </constant> <constant name="MIDI_MESSAGE_PITCH_BEND" value="14" enum="MIDIMessage"> - MIDI pitch bend message. + MIDI pitch bend message. This message is sent to indicate a change in the pitch bender (wheel or lever, typically). + </constant> + <constant name="MIDI_MESSAGE_SYSTEM_EXCLUSIVE" value="240" enum="MIDIMessage"> + MIDI system exclusive message. This has behavior exclusive to the device you're receiving input from. Getting this data is not implemented in Godot. + </constant> + <constant name="MIDI_MESSAGE_QUARTER_FRAME" value="241" enum="MIDIMessage"> + MIDI quarter frame message. Contains timing information that is used to synchronize MIDI devices. Getting this data is not implemented in Godot. + </constant> + <constant name="MIDI_MESSAGE_SONG_POSITION_POINTER" value="242" enum="MIDIMessage"> + MIDI song position pointer message. Gives the number of 16th notes since the start of the song. Getting this data is not implemented in Godot. + </constant> + <constant name="MIDI_MESSAGE_SONG_SELECT" value="243" enum="MIDIMessage"> + MIDI song select message. Specifies which sequence or song is to be played. Getting this data is not implemented in Godot. + </constant> + <constant name="MIDI_MESSAGE_TUNE_REQUEST" value="246" enum="MIDIMessage"> + MIDI tune request message. Upon receiving a tune request, all analog synthesizers should tune their oscillators. + </constant> + <constant name="MIDI_MESSAGE_TIMING_CLOCK" value="248" enum="MIDIMessage"> + MIDI timing clock message. Sent 24 times per quarter note when synchronization is required. + </constant> + <constant name="MIDI_MESSAGE_START" value="250" enum="MIDIMessage"> + MIDI start message. Start the current sequence playing. This message will be followed with Timing Clocks. + </constant> + <constant name="MIDI_MESSAGE_CONTINUE" value="251" enum="MIDIMessage"> + MIDI continue message. Continue at the point the sequence was stopped. + </constant> + <constant name="MIDI_MESSAGE_STOP" value="252" enum="MIDIMessage"> + MIDI stop message. Stop the current sequence. + </constant> + <constant name="MIDI_MESSAGE_ACTIVE_SENSING" value="254" enum="MIDIMessage"> + MIDI active sensing message. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. + </constant> + <constant name="MIDI_MESSAGE_SYSTEM_RESET" value="255" enum="MIDIMessage"> + MIDI system reset message. Reset all receivers in the system to power-up status. It should not be sent on power-up itself. </constant> <constant name="OK" value="0" enum="Error"> Methods that return [enum Error] return [constant OK] when no error occurred. Note that many functions don't return an error code but will print error messages to standard output. diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index 789c6bd960..1710b28537 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -12,12 +12,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> </tutorials> <methods> - <method name="is_playing" qualifiers="const"> - <return type="bool" /> - <description> - Returns [code]true[/code] if an animation is currently being played. - </description> - </method> <method name="play"> <return type="void" /> <argument index="0" name="anim" type="StringName" default="&""" /> @@ -55,7 +49,7 @@ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. </member> - <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false"> + <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false"> If [code]true[/code], the [member animation] is currently playing. </member> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index c9d8ae9936..08290523f7 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -5,7 +5,7 @@ </brief_description> <description> Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas. - Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. + Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. </description> <tutorials> <link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link> diff --git a/doc/classes/AspectRatioContainer.xml b/doc/classes/AspectRatioContainer.xml index 4c0af0b997..237bec4e61 100644 --- a/doc/classes/AspectRatioContainer.xml +++ b/doc/classes/AspectRatioContainer.xml @@ -9,10 +9,10 @@ <tutorials> </tutorials> <members> - <member name="alignment_horizontal" type="int" setter="set_alignment_horizontal" getter="get_alignment_horizontal" enum="AspectRatioContainer.AlignMode" default="1"> + <member name="alignment_horizontal" type="int" setter="set_alignment_horizontal" getter="get_alignment_horizontal" enum="AspectRatioContainer.AlignmentMode" default="1"> Specifies the horizontal relative position of child controls. </member> - <member name="alignment_vertical" type="int" setter="set_alignment_vertical" getter="get_alignment_vertical" enum="AspectRatioContainer.AlignMode" default="1"> + <member name="alignment_vertical" type="int" setter="set_alignment_vertical" getter="get_alignment_vertical" enum="AspectRatioContainer.AlignmentMode" default="1"> Specifies the vertical relative position of child controls. </member> <member name="ratio" type="float" setter="set_ratio" getter="get_ratio" default="1.0"> @@ -36,13 +36,13 @@ The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio. When the bounding rectangle of child controls exceed the container's size and [member Control.rect_clip_content] is enabled, this allows to show only the container's area restricted by its own bounding rectangle. </constant> - <constant name="ALIGN_BEGIN" value="0" enum="AlignMode"> + <constant name="ALIGNMENT_BEGIN" value="0" enum="AlignmentMode"> Aligns child controls with the beginning (left or top) of the container. </constant> - <constant name="ALIGN_CENTER" value="1" enum="AlignMode"> + <constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode"> Aligns child controls with the center of the container. </constant> - <constant name="ALIGN_END" value="2" enum="AlignMode"> + <constant name="ALIGNMENT_END" value="2" enum="AlignmentMode"> Aligns child controls with the end (right or bottom) of the container. </constant> </constants> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index aa2ffae48c..f6b16ed2e3 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -80,13 +80,16 @@ Threshold at which the alpha scissor will discard values. </member> <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy" default="0.0"> - The strength of the anisotropy effect. + The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel. </member> <member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> - If [code]true[/code], anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space. Mesh tangents are needed for this to work. If the mesh does not contain tangents the anisotropy effect will appear broken. + If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections. + [b]Note:[/b] Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken. + [b]Note:[/b] Material anisotropy should not to be confused with anisotropic texture filtering, which can be enabled by setting [member texture_filter] to [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC]. </member> <member name="anisotropy_flowmap" type="Texture2D" setter="set_texture" getter="get_texture"> - Texture that offsets the tangent map for anisotropy calculations. + Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion. + If present, the texture's alpha channel will be used to multiply the strength of the [member anisotropy] effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored. </member> <member name="ao_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], ambient occlusion is enabled. Ambient occlusion darkens areas based on the [member ao_texture]. diff --git a/doc/classes/BoxContainer.xml b/doc/classes/BoxContainer.xml index ec81b866f6..a968e855a5 100644 --- a/doc/classes/BoxContainer.xml +++ b/doc/classes/BoxContainer.xml @@ -18,19 +18,16 @@ </method> </methods> <members> - <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="BoxContainer.AlignMode" default="0"> - The alignment of the container's children (must be one of [constant ALIGN_BEGIN], [constant ALIGN_CENTER], or [constant ALIGN_END]). + <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="BoxContainer.AlignmentMode" default="0"> + The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). </member> </members> <constants> - <constant name="ALIGN_BEGIN" value="0" enum="AlignMode"> - Aligns children with the beginning of the container. + <constant name="ALIGNMENT_BEGIN" value="0" enum="AlignmentMode"> </constant> - <constant name="ALIGN_CENTER" value="1" enum="AlignMode"> - Aligns children with the center of the container. + <constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode"> </constant> - <constant name="ALIGN_END" value="2" enum="AlignMode"> - Aligns children with the end of the container. + <constant name="ALIGNMENT_END" value="2" enum="AlignmentMode"> </constant> </constants> </class> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 3145756511..65b66b2fd5 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -64,8 +64,8 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1"> - Text alignment policy for the button's text, use one of the [enum TextAlign] constants. + <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1"> + Text alignment policy for the button's text, use one of the [enum @GlobalScope.HorizontalAlignment] constants. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" default="false"> When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. @@ -80,8 +80,8 @@ Button's icon, if text is present the icon will be placed before the text. To edit margin and spacing of the icon, use [theme_item hseparation] theme property and [code]content_margin_*[/code] properties of the used [StyleBox]es. </member> - <member name="icon_align" type="int" setter="set_icon_align" getter="get_icon_align" enum="Button.TextAlign" default="0"> - Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum TextAlign] constants as the text alignment. If centered, text will draw on top of the icon. + <member name="icon_alignment" type="int" setter="set_icon_alignment" getter="get_icon_alignment" enum="HorizontalAlignment" default="0"> + Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum @GlobalScope.HorizontalAlignment] constants as the text alignment. If centered, text will draw on top of the icon. </member> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. @@ -93,17 +93,6 @@ Base text writing direction. </member> </members> - <constants> - <constant name="ALIGN_LEFT" value="0" enum="TextAlign"> - Align the text to the left. - </constant> - <constant name="ALIGN_CENTER" value="1" enum="TextAlign"> - Align the text to the center. - </constant> - <constant name="ALIGN_RIGHT" value="2" enum="TextAlign"> - Align the text to the right. - </constant> - </constants> <theme_items> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [Button]. @@ -160,7 +149,7 @@ [StyleBox] used when the [Button] is disabled. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [StyleBox] used when the [Button] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [Button] is being hovered. diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 0505d8ad36..a4415e89db 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -116,6 +116,9 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. </member> + <member name="color_initial_ramp" type="Gradient" setter="set_color_initial_ramp" getter="get_color_initial_ramp"> + Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). + </member> <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [Gradient] (multiplied with [member color]). </member> diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml index ad491465f2..da9c63c0f7 100644 --- a/doc/classes/CPUParticles3D.xml +++ b/doc/classes/CPUParticles3D.xml @@ -96,13 +96,13 @@ Minimum angle. </member> <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> - Each particle's angular velocity will vary along this [Curve]. + Each particle's angular velocity (rotation speed) will vary along this [Curve] over its lifetime. </member> <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum angular velocity. + Maximum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. </member> <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum angular velocity. + Minimum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. </member> <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation offset will vary along this [Curve]. @@ -125,6 +125,9 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Each particle's initial color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code]. </member> + <member name="color_initial_ramp" type="Gradient" setter="set_color_initial_ramp" getter="get_color_initial_ramp"> + Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). + </member> <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [GradientTexture1D] over its lifetime (multiplied with [member color]). </member> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 6a1782fc52..90663bfaa5 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -30,13 +30,15 @@ <method name="get_camera_position" qualifiers="const"> <return type="Vector2" /> <description> - Returns the camera position. + Returns the camera's [code]position[/code] (the tracked point the camera attempts to follow), relative to the origin. + [b]Note:[/b] The returned value is not the same as [member Node2D.position] or [member Node2D.global_position], as it is affected by the [code]drag[/code] properties. </description> </method> <method name="get_camera_screen_center" qualifiers="const"> <return type="Vector2" /> <description> Returns the location of the [Camera2D]'s screen-center, relative to the origin. + [b]Note:[/b] The real [code]position[/code] of the camera may be different, see [method get_camera_position]. </description> </method> <method name="get_drag_margin" qualifiers="const"> @@ -57,7 +59,7 @@ <return type="void" /> <description> Sets the camera's position immediately to its current smoothing destination. - This has no effect if smoothing is disabled. + This method has no effect if [member smoothing_enabled] is [code]false[/code]. </description> </method> <method name="set_drag_margin"> @@ -95,7 +97,7 @@ </member> <member name="drag_horizontal_offset" type="float" setter="set_drag_horizontal_offset" getter="get_drag_horizontal_offset" default="0.0"> 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. + [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 [member drag_horizontal_enabled] is [code]true[/code] or the drag margins are changed. </member> <member name="drag_left_margin" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Left margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the left edge of the screen. @@ -111,7 +113,7 @@ </member> <member name="drag_vertical_offset" type="float" setter="set_drag_vertical_offset" getter="get_drag_vertical_offset" default="0.0"> 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. + [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 [member drag_vertical_enabled] is [code]true[/code] or the drag margins are changed. </member> <member name="editor_draw_drag_margin" type="bool" setter="set_margin_drawing_enabled" getter="is_margin_drawing_enabled" default="false"> If [code]true[/code], draws the camera's drag margin rectangle in the editor. @@ -133,20 +135,20 @@ </member> <member name="limit_smoothed" type="bool" setter="set_limit_smoothing_enabled" getter="is_limit_smoothing_enabled" default="false"> If [code]true[/code], the camera smoothly stops when reaches its limits. - This has no effect if smoothing is disabled. + This property has no effect if [member smoothing_enabled] is [code]false[/code]. [b]Note:[/b] To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [method reset_smoothing]. </member> <member name="limit_top" type="int" setter="set_limit" getter="get_limit" default="-10000000"> Top scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> - The camera's relative offset. Useful for looking around or camera shake animations. The offseted camera can go past the limits defined in [member limit_top], [member limit_bottom], [member limit_left] and [member limit_right]. + The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [member limit_top], [member limit_bottom], [member limit_left] and [member limit_right]. </member> <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="Camera2D.Camera2DProcessCallback" default="1"> The camera's process callback. See [enum Camera2DProcessCallback]. </member> <member name="rotating" type="bool" setter="set_rotating" getter="is_rotating" default="false"> - If [code]true[/code], the camera rotates with the target. + If [code]true[/code], the camera view rotates with the target. </member> <member name="smoothing_enabled" type="bool" setter="set_enable_follow_smoothing" getter="is_follow_smoothing_enabled" default="false"> If [code]true[/code], the camera smoothly moves towards the target at [member smoothing_speed]. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 98437ef296..cf6a8bad5e 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -143,7 +143,7 @@ <argument index="0" name="font" type="Font" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="text" type="String" /> - <argument index="3" name="align" type="int" enum="HAlign" default="0" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> <argument index="5" name="max_lines" type="int" default="-1" /> <argument index="6" name="size" type="int" default="16" /> @@ -236,7 +236,7 @@ <argument index="0" name="font" type="Font" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="text" type="String" /> - <argument index="3" name="align" type="int" enum="HAlign" default="0" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> <argument index="5" name="size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> @@ -253,7 +253,7 @@ # so the Control is only created once. var default_font = Control.new().get_font("font") var default_font_size = Control.new().get_font_size("font_size") - draw_string(default_font, Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, font_size) + draw_string(default_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size) [/gdscript] [csharp] // If using this method in a script that redraws constantly, move the @@ -261,7 +261,7 @@ // so the Control is only created once. Font defaultFont = new Control().GetFont("font"); int defaultFontSize = new Control().GetFontSize("font_size"); - DrawString(defaultFont, new Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, defaultFontSize); + DrawString(defaultFont, new Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, defaultFontSize); [/csharp] [/codeblocks] See also [method Font.draw_string]. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 7dddacf3c9..6180f56858 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -10,7 +10,7 @@ <tutorials> </tutorials> <members> - <member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" /> + <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" /> <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" /> </members> <theme_items> @@ -76,7 +76,7 @@ The [StyleBox] to display as a background when the [CheckBox] is disabled. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckBox] is focused. + The [StyleBox] to display as a background when the [CheckBox] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> The [StyleBox] to display as a background when the [CheckBox] is hovered. diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index c0315b93be..659fb5126f 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -10,7 +10,7 @@ <tutorials> </tutorials> <members> - <member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" /> + <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" /> <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" /> </members> <theme_items> @@ -78,7 +78,7 @@ The [StyleBox] to display as a background when the [CheckButton] is disabled. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckButton] is focused. + The [StyleBox] to display as a background when the [CheckButton] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> The [StyleBox] to display as a background when the [CheckButton] is hovered. diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 04c3d73357..697b0443f1 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -234,7 +234,7 @@ <method name="get_folded_lines" qualifiers="const"> <return type="int[]" /> <description> - Return all lines that are current folded. + Returns all lines that are current folded. </description> </method> <method name="get_text_for_code_completion" qualifiers="const"> @@ -288,7 +288,7 @@ <argument index="0" name="line" type="int" /> <argument index="1" name="column" type="int" default="-1" /> <description> - Return delimiter index if [code]line[/code] [code]column[/code] is in a comment. If [code]column[/code] is not provided, will return delimiter index if the entire [code]line[/code] is a comment. Otherwise [code]-1[/code]. + Returns delimiter index if [code]line[/code] [code]column[/code] is in a comment. If [code]column[/code] is not provided, will return delimiter index if the entire [code]line[/code] is a comment. Otherwise [code]-1[/code]. </description> </method> <method name="is_in_string" qualifiers="const"> @@ -296,7 +296,7 @@ <argument index="0" name="line" type="int" /> <argument index="1" name="column" type="int" default="-1" /> <description> - Return the delimiter index if [code]line[/code] [code]column[/code] is in a string. If [code]column[/code] is not provided, will return the delimiter index if the entire [code]line[/code] is a string. Otherwise [code]-1[/code]. + Returns the delimiter index if [code]line[/code] [code]column[/code] is in a string. If [code]column[/code] is not provided, will return the delimiter index if the entire [code]line[/code] is a string. Otherwise [code]-1[/code]. </description> </method> <method name="is_line_bookmarked" qualifiers="const"> @@ -680,7 +680,7 @@ [StyleBox] for the code completion popup. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - Sets the [StyleBox] when in focus. + Sets the [StyleBox] when in focus. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> Sets the [StyleBox]. diff --git a/doc/classes/CodeHighlighter.xml b/doc/classes/CodeHighlighter.xml index 064be0c29d..efd8f618e7 100644 --- a/doc/classes/CodeHighlighter.xml +++ b/doc/classes/CodeHighlighter.xml @@ -76,21 +76,21 @@ <return type="bool" /> <argument index="0" name="start_key" type="String" /> <description> - Return [code]true[/code] if the start key exists, else [code]false[/code]. + Returns [code]true[/code] if the start key exists, else [code]false[/code]. </description> </method> <method name="has_keyword_color" qualifiers="const"> <return type="bool" /> <argument index="0" name="keyword" type="String" /> <description> - Return [code]true[/code] if the keyword exists, else [code]false[/code]. + Returns [code]true[/code] if the keyword exists, else [code]false[/code]. </description> </method> <method name="has_member_keyword_color" qualifiers="const"> <return type="bool" /> <argument index="0" name="member_keyword" type="String" /> <description> - Return [code]true[/code] if the member keyword exists, else [code]false[/code]. + Returns [code]true[/code] if the member keyword exists, else [code]false[/code]. </description> </method> <method name="remove_color_region"> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 22fb853b40..f3fcd90f51 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -4,7 +4,7 @@ Color in RGBA format using floats on the range of 0 to 1. </brief_description> <description> - 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). + A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for opacity. 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 the string constructor 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]. @@ -30,10 +30,10 @@ Constructs a [Color] from an existing color, but with a custom alpha value. [codeblocks] [gdscript] - var red = Color(Color.red, 0.5) # 50% transparent red. + var red = Color(Color.red, 0.2) # 20% opaque red. [/gdscript] [csharp] - var red = new Color(Colors.Red, 0.5f); // 50% transparent red. + var red = new Color(Colors.Red, 0.2f); // 20% opaque red. [/csharp] [/codeblocks] </description> @@ -178,6 +178,13 @@ <description> </description> </method> + <method name="get_luminance" qualifiers="const"> + <return type="float" /> + <description> + Returns the luminance of the color in the [code][0.0, 1.0][/code] range. + This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark. + </description> + </method> <method name="get_named_color" qualifiers="static"> <return type="Color" /> <argument index="0" name="idx" type="int" /> @@ -398,7 +405,7 @@ </methods> <members> <member name="a" type="float" setter="" getter="" default="1.0"> - The color's alpha (transparency) component, typically on the range of 0 to 1. + The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque. </member> <member name="a8" type="int" setter="" getter="" default="255"> Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1. diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 22439f6ca5..cb543afaba 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -41,7 +41,7 @@ If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). </member> <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true"> - If [code]true[/code], shows an alpha channel slider (transparency). + If [code]true[/code], shows an alpha channel slider (opacity). </member> <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false"> If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders. diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 2f78b10660..7fd6ffcc0d 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -93,7 +93,7 @@ [StyleBox] used when the [ColorPickerButton] is disabled. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [StyleBox] used when the [ColorPickerButton] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [ColorPickerButton] is being hovered. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index ed6a71d5c3..3d8199831d 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -102,6 +102,7 @@ <description> Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). If not overridden, defaults to [constant Vector2.ZERO]. + [b]Note:[/b] This method will not be called when the script is attached to a [Control] node that already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be used with most basic GUI nodes, like [Control], [Container], [Panel] etc. </description> </method> <method name="_gui_input" qualifiers="virtual"> @@ -200,7 +201,7 @@ <argument index="1" name="text" type="String" /> <description> User defined BiDi algorithm override function. - Return [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately. + Returns [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately. </description> </method> <method name="accept_event"> diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index ec7583e68b..62f8f00a82 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -20,7 +20,7 @@ </methods> <members> <member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array()"> - The polygon's list of vertices. Can be in either clockwise or counterclockwise order. + The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use [method set_point_cloud] to generate a convex hull shape from concave shape points. </member> </members> </class> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml index 111da858ea..9e56a41fee 100644 --- a/doc/classes/CryptoKey.xml +++ b/doc/classes/CryptoKey.xml @@ -14,7 +14,7 @@ <method name="is_public_only" qualifiers="const"> <return type="bool" /> <description> - Return [code]true[/code] if this CryptoKey only has the public part, and not the private one. + Returns [code]true[/code] if this CryptoKey only has the public part, and not the private one. </description> </method> <method name="load"> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index cd4b8fde1e..3f0a5610b1 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -108,17 +108,37 @@ Returns the currently opened directory's drive index. See [method get_drive] to convert returned index to the name of the drive. </description> </method> + <method name="get_directories"> + <return type="PackedStringArray" /> + <description> + Returns a [PackedStringArray] containing filenames of the directory contents, excluding files. The array is sorted alphabetically. + Affected by [member include_hidden] and [member include_navigational]. + </description> + </method> <method name="get_drive"> <return type="String" /> <argument index="0" name="idx" type="int" /> <description> - On Windows, returns the name of the drive (partition) passed as an argument (e.g. [code]C:[/code]). On other platforms, or if the requested drive does not exist, the method returns an empty String. + On Windows, returns the name of the drive (partition) passed as an argument (e.g. [code]C:[/code]). + On macOS, returns the path to the mounted volume passed as an argument. + On Linux, returns the path to the mounted volume or GTK 3 bookmark passed as an argument. + On other platforms, or if the requested drive does not exist, the method returns an empty String. </description> </method> <method name="get_drive_count"> <return type="int" /> <description> - On Windows, returns the number of drives (partitions) mounted on the current filesystem. On other platforms, the method returns 0. + On Windows, returns the number of drives (partitions) mounted on the current filesystem. + On macOS, returns the number of mounted volumes. + On Linux, returns the number of mounted volumes and GTK 3 bookmarks. + On other platforms, the method returns 0. + </description> + </method> + <method name="get_files"> + <return type="PackedStringArray" /> + <description> + Returns a [PackedStringArray] containing filenames of the directory contents, excluding directories. The array is sorted alphabetically. + Affected by [member include_hidden]. </description> </method> <method name="get_next"> @@ -136,12 +156,10 @@ </method> <method name="list_dir_begin"> <return type="int" enum="Error" /> - <argument index="0" name="show_navigational" type="bool" default="false" /> - <argument index="1" name="show_hidden" type="bool" default="false" /> <description> Initializes the stream used to list all files and directories using the [method get_next] function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. - If [code]show_navigational[/code] is [code]true[/code], [code].[/code] and [code]..[/code] are included too. - If [code]show_hidden[/code] is [code]true[/code], hidden files are included too. + Affected by [member include_hidden] and [member include_navigational]. + [b]Note:[/b] The order of files and directories returned by this method is not deterministic, and can vary between operating systems. If you want a list of all files or folders sorted alphabetically, use [method get_files] or [method get_directories]. </description> </method> <method name="list_dir_end"> @@ -192,4 +210,14 @@ </description> </method> </methods> + <members> + <member name="include_hidden" type="bool" setter="set_include_hidden" getter="get_include_hidden" default="false"> + If [code]true[/code], hidden files are included when the navigating directory. + Affects [method list_dir_begin], [method get_directories] and [method get_files]. + </member> + <member name="include_navigational" type="bool" setter="set_include_navigational" getter="get_include_navigational" default="false"> + If [code]true[/code], [code].[/code] and [code]..[/code] are included when navigating the directory. + Affects [method list_dir_begin] and [method get_directories]. + </member> + </members> </class> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 1ca69057b4..a41875385c 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -392,7 +392,7 @@ <method name="screen_get_max_scale" qualifiers="const"> <return type="float" /> <description> - Return the greatest scale factor of all screens. + Returns the greatest scale factor of all screens. [b]Note:[/b] On macOS returned value is [code]2.0[/code] if there is at least one hiDPI (Retina) screen in the system, and [code]1.0[/code] in all other cases. [b]Note:[/b] This method is implemented on macOS. </description> @@ -413,7 +413,7 @@ <return type="float" /> <argument index="0" name="screen" type="int" default="-1" /> <description> - Return the scale factor of the specified screen by index. + Returns the scale factor of the specified screen by index. [b]Note:[/b] On macOS returned value is [code]2.0[/code] for hiDPI (Retina) screen, and [code]1.0[/code] for all other cases. [b]Note:[/b] This method is implemented on macOS. </description> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index 1f98781bbd..50c227dc0a 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -163,7 +163,7 @@ } [/csharp] [/codeblocks] - Return [code]true[/code] to make all options always visible. + Returns [code]true[/code] to make all options always visible. </description> </method> <method name="_get_preset_count" qualifiers="virtual const"> diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 46cebbd795..dbfbaf103d 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -10,7 +10,7 @@ <tutorials> </tutorials> <members> - <member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" overrides="ScrollContainer" default="false" /> + <member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" /> </members> <signals> <signal name="object_id_selected"> diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 5790d8c5af..15d31cd0f0 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -21,7 +21,17 @@ <return type="void" /> <argument index="0" name="resource" type="Resource" /> <description> - Edits the given [Resource]. + Edits the given [Resource]. If the resource is a [Script] you can also edit it with [method edit_script] to specify the line and column position. + </description> + </method> + <method name="edit_script"> + <return type="void" /> + <argument index="0" name="script" type="Script" /> + <argument index="1" name="line" type="int" default="-1" /> + <argument index="2" name="column" type="int" default="0" /> + <argument index="3" name="grab_focus" type="bool" default="true" /> + <description> + Edits the given [Script]. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor. </description> </method> <method name="get_base_control"> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index c3d1dc4ab6..2090672acc 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -238,7 +238,22 @@ The distance at which objects can occlude each other when calculating screen-space ambient occlusion. Higher values will result in occlusion over a greater distance at the cost of performance and quality. </member> <member name="ssao_sharpness" type="float" setter="set_ssao_sharpness" getter="get_ssao_sharpness" default="0.98"> - Sharpness refers to the amount that the screen-space ambient occlusion effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. + The amount that the screen-space ambient occlusion effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. + </member> + <member name="ssil_enabled" type="bool" setter="set_ssil_enabled" getter="is_ssil_enabled" default="false"> + If [code]true[/code], the screen-space indirect lighting effect is enabled. Screen space indirect lighting is a form of indirect lighting that allows diffuse light to bounce between nearby objects. Screen-space indirect lighting works very similarly to screen-space ambient occlusion, in that it only affects a limited range. It is intended to be used along with a form of proper global illumination like SDFGI or [VoxelGI]. Screen-space indirect lighting is not affected by individual light's [member Light3D.light_indirect_energy]. + </member> + <member name="ssil_intensity" type="float" setter="set_ssil_intensity" getter="get_ssil_intensity" default="1.0"> + The brightness multiplier for the screen-space indirect lighting effect. A higher value will result in brighter light. + </member> + <member name="ssil_normal_rejection" type="float" setter="set_ssil_normal_rejection" getter="get_ssil_normal_rejection" default="1.0"> + Amount of normal rejection used when calculating screen-space indirect lighting. Normal rejection uses the normal of a given sample point to reject samples that are facing away from the current pixel. Normal rejection is necessary to avoid light leaking when only one side of an object is illuminated. However, normal rejection can be disabled if light leaking is desirable, such as when the scene mostly contains emissive objects that emit light from faces that cannot be seen from the camera. + </member> + <member name="ssil_radius" type="float" setter="set_ssil_radius" getter="get_ssil_radius" default="5.0"> + The distance that bounced lighting can travel when using the screen space indirect lighting effect. A larger value will result in light bouncing further in a scene, but may result in under-sampling artifacts which look like long spikes surrounding light sources. + </member> + <member name="ssil_sharpness" type="float" setter="set_ssil_sharpness" getter="get_ssil_sharpness" default="0.98"> + The amount that the screen-space indirect lighting effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. </member> <member name="tonemap_exposure" type="float" setter="set_tonemap_exposure" getter="get_tonemap_exposure" default="1.0"> The default exposure used for tonemapping. diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 01bc2837f1..3537fc0b66 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -96,7 +96,7 @@ <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="text" type="String" /> - <argument index="3" name="align" type="int" enum="HAlign" default="0" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> <argument index="5" name="max_lines" type="int" default="-1" /> <argument index="6" name="size" type="int" default="16" /> @@ -114,7 +114,7 @@ <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="text" type="String" /> - <argument index="3" name="align" type="int" enum="HAlign" default="0" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> <argument index="5" name="size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> @@ -202,7 +202,7 @@ <return type="Vector2" /> <argument index="0" name="text" type="String" /> <argument index="1" name="size" type="int" default="16" /> - <argument index="2" name="align" type="int" enum="HAlign" default="0" /> + <argument index="2" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="3" name="width" type="float" default="-1" /> <argument index="4" name="flags" type="int" default="3" /> <description> @@ -222,7 +222,7 @@ <return type="float" /> <argument index="0" name="size" type="int" default="16" /> <description> - Return average pixel offset of the underline below the baseline. + Returns average pixel offset of the underline below the baseline. [b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. </description> </method> @@ -230,7 +230,7 @@ <return type="float" /> <argument index="0" name="size" type="int" default="16" /> <description> - Return average thickness of the underline. + Returns average thickness of the underline. [b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. </description> </method> @@ -238,7 +238,7 @@ <return type="bool" /> <argument index="0" name="char" type="int" /> <description> - Return [code]true[/code] if a Unicode [code]char[/code] is available in the font. + Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> <method name="remove_data"> diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml index c403d238c5..0c8386784e 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontData.xml @@ -259,7 +259,7 @@ <return type="Array" /> <argument index="0" name="cache_index" type="int" /> <description> - Return list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. + Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> <method name="get_spacing" qualifiers="const"> @@ -343,7 +343,7 @@ <return type="bool" /> <argument index="0" name="char" type="int" /> <description> - Return [code]true[/code] if a Unicode [code]char[/code] is available in the font. + Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> <method name="is_antialiased" qualifiers="const"> @@ -355,7 +355,7 @@ <method name="is_force_autohinter" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only. + Returns [code]true[/code] if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. </description> </method> <method name="is_language_supported" qualifiers="const"> @@ -519,7 +519,7 @@ <return type="void" /> <argument index="0" name="force_autohinter" type="bool" /> <description> - If set to [code]true[/code] auto-hinting is preffered over font built-in hinting. + If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. </description> </method> <method name="set_glyph_advance"> diff --git a/doc/classes/GPUParticlesAttractorBox.xml b/doc/classes/GPUParticlesAttractorBox3D.xml index 93fdc45e56..0795e11b16 100644 --- a/doc/classes/GPUParticlesAttractorBox.xml +++ b/doc/classes/GPUParticlesAttractorBox3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesAttractorBox" inherits="GPUParticlesAttractor3D" version="4.0"> +<class name="GPUParticlesAttractorBox3D" inherits="GPUParticlesAttractor3D" version="4.0"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GPUParticlesAttractorSphere.xml b/doc/classes/GPUParticlesAttractorSphere3D.xml index 4398de55e9..590c966d70 100644 --- a/doc/classes/GPUParticlesAttractorSphere.xml +++ b/doc/classes/GPUParticlesAttractorSphere3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesAttractorSphere" inherits="GPUParticlesAttractor3D" version="4.0"> +<class name="GPUParticlesAttractorSphere3D" inherits="GPUParticlesAttractor3D" version="4.0"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GPUParticlesAttractorVectorField.xml b/doc/classes/GPUParticlesAttractorVectorField3D.xml index e164343528..d0dbf886f6 100644 --- a/doc/classes/GPUParticlesAttractorVectorField.xml +++ b/doc/classes/GPUParticlesAttractorVectorField3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesAttractorVectorField" inherits="GPUParticlesAttractor3D" version="4.0"> +<class name="GPUParticlesAttractorVectorField3D" inherits="GPUParticlesAttractor3D" version="4.0"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GPUParticlesCollisionBox.xml b/doc/classes/GPUParticlesCollisionBox3D.xml index d2bf4ef538..e899637206 100644 --- a/doc/classes/GPUParticlesCollisionBox.xml +++ b/doc/classes/GPUParticlesCollisionBox3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesCollisionBox" inherits="GPUParticlesCollision3D" version="4.0"> +<class name="GPUParticlesCollisionBox3D" inherits="GPUParticlesCollision3D" version="4.0"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GPUParticlesCollisionHeightField.xml b/doc/classes/GPUParticlesCollisionHeightField3D.xml index 99b2ad3ce0..801120d911 100644 --- a/doc/classes/GPUParticlesCollisionHeightField.xml +++ b/doc/classes/GPUParticlesCollisionHeightField3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesCollisionHeightField" inherits="GPUParticlesCollision3D" version="4.0"> +<class name="GPUParticlesCollisionHeightField3D" inherits="GPUParticlesCollision3D" version="4.0"> <brief_description> </brief_description> <description> @@ -13,9 +13,9 @@ </member> <member name="follow_camera_push_ratio" type="float" setter="set_follow_camera_push_ratio" getter="get_follow_camera_push_ratio" default="0.1"> </member> - <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionHeightField.Resolution" default="2"> + <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionHeightField3D.Resolution" default="2"> </member> - <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="GPUParticlesCollisionHeightField.UpdateMode" default="0"> + <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="GPUParticlesCollisionHeightField3D.UpdateMode" default="0"> </member> </members> <constants> diff --git a/doc/classes/GPUParticlesCollisionSDF.xml b/doc/classes/GPUParticlesCollisionSDF3D.xml index 8d798a9d28..9e86d16eef 100644 --- a/doc/classes/GPUParticlesCollisionSDF.xml +++ b/doc/classes/GPUParticlesCollisionSDF3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesCollisionSDF" inherits="GPUParticlesCollision3D" version="4.0"> +<class name="GPUParticlesCollisionSDF3D" inherits="GPUParticlesCollision3D" version="4.0"> <brief_description> </brief_description> <description> @@ -9,7 +9,7 @@ <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> </member> - <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionSDF.Resolution" default="2"> + <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionSDF3D.Resolution" default="2"> </member> <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture"> </member> diff --git a/doc/classes/GPUParticlesCollisionSphere.xml b/doc/classes/GPUParticlesCollisionSphere3D.xml index ddb2391fd9..82728f853b 100644 --- a/doc/classes/GPUParticlesCollisionSphere.xml +++ b/doc/classes/GPUParticlesCollisionSphere3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GPUParticlesCollisionSphere" inherits="GPUParticlesCollision3D" version="4.0"> +<class name="GPUParticlesCollisionSphere3D" inherits="GPUParticlesCollision3D" version="4.0"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index b8514c67b8..0d230288a8 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -59,12 +59,14 @@ </member> <member name="visibility_range_begin_margin" type="float" setter="set_visibility_range_begin_margin" getter="get_visibility_range_begin_margin" default="0.0"> Margin for the [member visibility_range_begin] threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the [member visibility_range_begin] threshold by this amount. + If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. </member> <member name="visibility_range_end" type="float" setter="set_visibility_range_end" getter="get_visibility_range_end" default="0.0"> Distance from which the GeometryInstance3D will be hidden, taking [member visibility_range_end_margin] into account as well. The default value of 0 is used to disable the range check. </member> <member name="visibility_range_end_margin" type="float" setter="set_visibility_range_end_margin" getter="get_visibility_range_end_margin" default="0.0"> Margin for the [member visibility_range_end] threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the [member visibility_range_end] threshold by this amount. + If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. </member> <member name="visibility_range_fade_mode" type="int" setter="set_visibility_range_fade_mode" getter="get_visibility_range_fade_mode" enum="GeometryInstance3D.VisibilityRangeFadeMode" default="0"> Controls which instances will be faded when approaching the limits of the visibility range. See [enum VisibilityRangeFadeMode] for possible values. @@ -111,13 +113,13 @@ Represents the size of the [enum LightmapScale] enum. </constant> <constant name="VISIBILITY_RANGE_FADE_DISABLED" value="0" enum="VisibilityRangeFadeMode"> - Will not fade itself nor its visibility dependencies, hysteresis will be used instead. See [member visibility_range_begin] and [member Node3D.visibility_parent] for more information. + Will not fade itself nor its visibility dependencies, hysteresis will be used instead. This is the fastest approach to manual LOD, but it can result in noticeable LOD transitions depending on how the LOD meshes are authored. See [member visibility_range_begin] and [member Node3D.visibility_parent] for more information. </constant> <constant name="VISIBILITY_RANGE_FADE_SELF" value="1" enum="VisibilityRangeFadeMode"> - Will fade-out itself when reaching the limits of its own visibility range. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin]. + Will fade-out itself when reaching the limits of its own visibility range. This is slower than [constant VISIBILITY_RANGE_FADE_DISABLED], but it can provide smoother transitions. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin]. </constant> <constant name="VISIBILITY_RANGE_FADE_DEPENDENCIES" value="2" enum="VisibilityRangeFadeMode"> - Will fade-in its visibility dependencies (see [member Node3D.visibility_parent]) when reaching the limits of its own visibility range. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin]. + Will fade-in its visibility dependencies (see [member Node3D.visibility_parent]) when reaching the limits of its own visibility range. This is slower than [constant VISIBILITY_RANGE_FADE_DISABLED], but it can provide smoother transitions. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin]. </constant> </constants> </class> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 76b255e273..c432410d3b 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -18,6 +18,43 @@ Virtual method which can be overridden to customize how connections are drawn. </description> </method> + <method name="_is_in_input_hotzone" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="graph_node" type="Object" /> + <argument index="1" name="slot_index" type="int" /> + <argument index="2" name="mouse_position" type="Vector2" /> + <description> + Returns whether the [code]mouse_position[/code] is in the input hot zone. + By default, a hot zone is a [Rect2] positioned such that its center is at [code]graph_node[/code].[method GraphNode.get_connection_input_position]([code]slot_index[/code]) (For output's case, call [method GraphNode.get_connection_output_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code]. + Below is a sample code to help get started: + [codeblock] + func _is_in_input_hotzone(graph_node, slot_index, mouse_position): + var slot_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) + var slot_pos : Vector2 = graph_node.get_position() + graph_node.get_connection_input_position(slot_index) - slot_size / 2 + var rect = Rect2(slot_pos, slot_size) + + return rect.has_point(mouse_position) + [/codeblock] + </description> + </method> + <method name="_is_in_output_hotzone" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="graph_node" type="Object" /> + <argument index="1" name="slot_index" type="int" /> + <argument index="2" name="mouse_position" type="Vector2" /> + <description> + Returns whether the [code]mouse_position[/code] is in the output hot zone. For more information on hot zones, see [method _is_in_input_hotzone]. + Below is a sample code to help get started: + [codeblock] + func _is_in_output_hotzone(graph_node, slot_index, mouse_position): + var slot_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) + var slot_pos : Vector2 = graph_node.get_position() + graph_node.get_connection_output_position(slot_index) - slot_size / 2 + var rect = Rect2(slot_pos, slot_size) + + return rect.has_point(mouse_position) + [/codeblock] + </description> + </method> <method name="add_valid_connection_type"> <return type="void" /> <argument index="0" name="from_type" type="int" /> diff --git a/doc/classes/HMACContext.xml b/doc/classes/HMACContext.xml index 69ad194fe0..b29f821da5 100644 --- a/doc/classes/HMACContext.xml +++ b/doc/classes/HMACContext.xml @@ -5,52 +5,52 @@ </brief_description> <description> The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it supports creating the message over time rather than providing it all at once. - [codeblocks] - [gdscript] - extends Node - var ctx = HMACContext.new() + [codeblocks] + [gdscript] + extends Node + var ctx = HMACContext.new() - func _ready(): - var key = "supersecret".to_utf8() - var err = ctx.start(HashingContext.HASH_SHA256, key) - assert(err == OK) - var msg1 = "this is ".to_utf8() - var msg2 = "vewy vewy secret".to_utf8() - err = ctx.update(msg1) - assert(err == OK) - err = ctx.update(msg2) - assert(err == OK) - var hmac = ctx.finish() - print(hmac.hex_encode()) + func _ready(): + var key = "supersecret".to_utf8() + var err = ctx.start(HashingContext.HASH_SHA256, key) + assert(err == OK) + var msg1 = "this is ".to_utf8() + var msg2 = "vewy vewy secret".to_utf8() + err = ctx.update(msg1) + assert(err == OK) + err = ctx.update(msg2) + assert(err == OK) + var hmac = ctx.finish() + print(hmac.hex_encode()) - [/gdscript] - [csharp] - using Godot; - using System; - using System.Diagnostics; + [/gdscript] + [csharp] + using Godot; + using System; + using System.Diagnostics; - public class CryptoNode : Node - { - private HMACContext ctx = new HMACContext(); - public override void _Ready() - { - PackedByteArray key = String("supersecret").to_utf8(); - Error err = ctx.Start(HashingContext.HASH_SHA256, key); - GD.Assert(err == OK); - PackedByteArray msg1 = String("this is ").to_utf8(); - PackedByteArray msg2 = String("vewy vew secret").to_utf8(); - err = ctx.Update(msg1); - GD.Assert(err == OK); - err = ctx.Update(msg2); - GD.Assert(err == OK); - PackedByteArray hmac = ctx.Finish(); - GD.Print(hmac.HexEncode()); - } - } + public class CryptoNode : Node + { + private HMACContext ctx = new HMACContext(); + public override void _Ready() + { + PackedByteArray key = String("supersecret").to_utf8(); + Error err = ctx.Start(HashingContext.HASH_SHA256, key); + GD.Assert(err == OK); + PackedByteArray msg1 = String("this is ").to_utf8(); + PackedByteArray msg2 = String("vewy vew secret").to_utf8(); + err = ctx.Update(msg1); + GD.Assert(err == OK); + err = ctx.Update(msg2); + GD.Assert(err == OK); + PackedByteArray hmac = ctx.Finish(); + GD.Print(hmac.HexEncode()); + } + } - [/csharp] - [/codeblocks] - [b]Note:[/b] Not available in HTML5 exports. + [/csharp] + [/codeblocks] + [b]Note:[/b] Not available in HTML5 exports. </description> <tutorials> </tutorials> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index aaaf863c69..c92f751c60 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -208,6 +208,24 @@ Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host. </description> </method> + <method name="set_http_proxy"> + <return type="void" /> + <argument index="0" name="host" type="String" /> + <argument index="1" name="port" type="int" /> + <description> + Sets the proxy server for HTTP requests. + The proxy server is unset if [code]host[/code] is empty or [code]port[/code] is -1. + </description> + </method> + <method name="set_https_proxy"> + <return type="void" /> + <argument index="0" name="host" type="String" /> + <argument index="1" name="port" type="int" /> + <description> + Sets the proxy server for HTTPS requests. + The proxy server is unset if [code]host[/code] is empty or [code]port[/code] is -1. + </description> + </method> </methods> <members> <member name="accept_gzip" type="bool" setter="set_accept_gzip" getter="is_accepting_gzip" default="true"> diff --git a/doc/classes/InputEventMIDI.xml b/doc/classes/InputEventMIDI.xml index 040eee7b98..1e41d09ac0 100644 --- a/doc/classes/InputEventMIDI.xml +++ b/doc/classes/InputEventMIDI.xml @@ -1,27 +1,96 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="InputEventMIDI" inherits="InputEvent" version="4.0"> <brief_description> + Input event for MIDI inputs. </brief_description> <description> + InputEventMIDI allows receiving input events from MIDI devices such as a piano. MIDI stands for Musical Instrument Digital Interface. + MIDI signals can be sent over a 5-pin MIDI connector or over USB, if your device supports both be sure to check the settings in the device to see which output it's using. + To receive input events from MIDI devices, you need to call [method OS.open_midi_inputs]. You can check which devices are detected using [method OS.get_connected_midi_inputs]. + [codeblocks] + [gdscript] + func _ready(): + OS.open_midi_inputs() + print(OS.get_connected_midi_inputs()) + + func _input(input_event): + if input_event is InputEventMIDI: + _print_midi_info(input_event) + + func _print_midi_info(midi_event: InputEventMIDI): + print(midi_event) + print("Channel " + str(midi_event.channel)) + print("Message " + str(midi_event.message)) + print("Pitch " + str(midi_event.pitch)) + print("Velocity " + str(midi_event.velocity)) + print("Instrument " + str(midi_event.instrument)) + print("Pressure " + str(midi_event.pressure)) + print("Controller number: " + str(midi_event.controller_number)) + print("Controller value: " + str(midi_event.controller_value)) + [/gdscript] + [csharp] + public override void _Ready() + { + OS.OpenMidiInputs(); + GD.Print(OS.GetConnectedMidiInputs()); + } + + public override void _Input(InputEvent inputEvent) + { + if (inputEvent is InputEventMIDI midiEvent) + { + PrintMIDIInfo(midiEvent); + } + } + + private void PrintMIDIInfo(InputEventMIDI midiEvent) + { + GD.Print(midiEvent); + GD.Print("Channel " + midiEvent.Channel); + GD.Print("Message " + midiEvent.Message); + GD.Print("Pitch " + midiEvent.Pitch); + GD.Print("Velocity " + midiEvent.Velocity); + GD.Print("Instrument " + midiEvent.Instrument); + GD.Print("Pressure " + midiEvent.Pressure); + GD.Print("Controller number: " + midiEvent.ControllerNumber); + GD.Print("Controller value: " + midiEvent.ControllerValue); + } + [/csharp] + [/codeblocks] + Note that Godot does not currently support MIDI output, so there is no way to emit MIDI signals from Godot. Only MIDI input works. </description> <tutorials> + <link title="MIDI Message Status Byte List">https://www.midi.org/specifications-old/item/table-2-expanded-messages-list-status-bytes</link> + <link title="Wikipedia General MIDI Instrument List">https://en.wikipedia.org/wiki/General_MIDI#Program_change_events</link> + <link title="Wikipedia Piano Key Frequencies List">https://en.wikipedia.org/wiki/Piano_key_frequencies#List</link> </tutorials> <members> <member name="channel" type="int" setter="set_channel" getter="get_channel" default="0"> + The MIDI channel of this input event. There are 16 channels, so this value ranges from 0 to 15. MIDI channel 9 is reserved for the use with percussion instruments, the rest of the channels are for non-percussion instruments. </member> <member name="controller_number" type="int" setter="set_controller_number" getter="get_controller_number" default="0"> + If the message is [code]MIDI_MESSAGE_CONTROL_CHANGE[/code], this indicates the controller number, otherwise this is zero. Controllers include devices such as pedals and levers. </member> <member name="controller_value" type="int" setter="set_controller_value" getter="get_controller_value" default="0"> + If the message is [code]MIDI_MESSAGE_CONTROL_CHANGE[/code], this indicates the controller value, otherwise this is zero. Controllers include devices such as pedals and levers. </member> <member name="instrument" type="int" setter="set_instrument" getter="get_instrument" default="0"> + The instrument of this input event. This value ranges from 0 to 127. Refer to the instrument list on the General MIDI wikipedia article to see a list of instruments, except that this value is 0-index, so subtract one from every number on that chart. A standard piano will have an instrument number of 0. </member> <member name="message" type="int" setter="set_message" getter="get_message" enum="MIDIMessage" default="0"> + Returns a value indicating the type of message for this MIDI signal. This is a member of the MIDIMessage enum. + For MIDI messages between 0x80 and 0xEF, only the left half of the bits are returned as this value, as the other part is the channel (ex: 0x94 becomes 0x9). For MIDI messages from 0xF0 to 0xFF, the value is returned as-is. + Notes will return [code]MIDI_MESSAGE_NOTE_ON[/code] when activated, but they might not always return [code]MIDI_MESSAGE_NOTE_OFF[/code] when deactivated, therefore your code should treat the input as stopped if some period of time has passed. + For more information, see the MIDI message status byte list chart linked above. </member> <member name="pitch" type="int" setter="set_pitch" getter="get_pitch" default="0"> + The pitch index number of this MIDI signal. This value ranges from 0 to 127. On a piano, middle C is 60, and A440 is 69, see the "MIDI note" column of the piano key frequency chart on Wikipedia for more information. </member> <member name="pressure" type="int" setter="set_pressure" getter="get_pressure" default="0"> + The pressure of the MIDI signal. This value ranges from 0 to 127. For many devices, this value is always zero. </member> <member name="velocity" type="int" setter="set_velocity" getter="get_velocity" default="0"> + The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. </member> </members> </class> diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml index 4878090996..5215c29b4a 100644 --- a/doc/classes/InputEventMouse.xml +++ b/doc/classes/InputEventMouse.xml @@ -14,10 +14,10 @@ The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks. </member> <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" default="Vector2(0, 0)"> - The global mouse position relative to the current [Viewport] when used in [method Control._gui_input], otherwise is at 0,0. + The global mouse position relative to the current [Viewport]. If used in [method Control._gui_input] and if the current [Control] is not under the mouse, moving it will not update this value. </member> <member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)"> - The local mouse position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] which is under the mouse. + The local mouse position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] which is under the mouse. If the current [Control] is not under the mouse, moving it will not update this value. </member> </members> </class> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 7263687ea8..593d0c9523 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -155,10 +155,10 @@ Returns an array with the indexes of the selected items. </description> </method> - <method name="get_v_scroll"> + <method name="get_v_scroll_bar"> <return type="VScrollBar" /> <description> - Returns the [Object] ID associated with the list. + Returns the vertical scrollbar. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. </description> </method> diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml index b003224ad4..6b32d680eb 100644 --- a/doc/classes/Joint2D.xml +++ b/doc/classes/Joint2D.xml @@ -11,6 +11,7 @@ <members> <member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.0"> When [member node_a] and [member node_b] move in different directions the [code]bias[/code] controls how fast the joint pulls them back to their original position. The lower the [code]bias[/code] the more the two bodies can pull on the joint. + When set to [code]0[/code], the default value from [member ProjectSettings.physics/2d/solver/default_constraint_bias] is used. </member> <member name="disable_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true"> If [code]true[/code], [member node_a] and [member node_b] can not collide. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index bb273bcf48..bdf451e710 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -61,15 +61,15 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align" default="0"> - Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [enum Align] constants. - </member> <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="Label.AutowrapMode" default="0"> If set to something other than [constant AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum AutowrapMode]. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" default="false"> If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. </member> + <member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> + Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. + </member> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </member> @@ -82,6 +82,7 @@ <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="2" /> <member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" default="1.0"> Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. + [b]Note:[/b] Setting this property updates [member visible_characters] based on current [method get_total_character_count]. </member> <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" default="4" /> <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0"> @@ -102,38 +103,18 @@ <member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" default="false"> If [code]true[/code], all the text displays as UPPERCASE. </member> - <member name="valign" type="int" setter="set_valign" getter="get_valign" enum="Label.VAlign" default="0"> - Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [enum VAlign] constants. + <member name="vertical_alignment" type="int" setter="set_vertical_alignment" getter="get_vertical_alignment" enum="VerticalAlignment" default="0"> + Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants. </member> <member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1"> Restricts the number of characters to display. Set to -1 to disable. + [b]Note:[/b] Setting this property updates [member percent_visible] based on current [method get_total_character_count]. + </member> + <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="Label.VisibleCharactersBehavior" default="0"> + Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum VisibleCharactersBehavior] for more info. </member> </members> <constants> - <constant name="ALIGN_LEFT" value="0" enum="Align"> - Align rows to the left (default). - </constant> - <constant name="ALIGN_CENTER" value="1" enum="Align"> - Align rows centered. - </constant> - <constant name="ALIGN_RIGHT" value="2" enum="Align"> - Align rows to the right. - </constant> - <constant name="ALIGN_FILL" value="3" enum="Align"> - Expand row to fit the width. - </constant> - <constant name="VALIGN_TOP" value="0" enum="VAlign"> - Align the whole text to the top. - </constant> - <constant name="VALIGN_CENTER" value="1" enum="VAlign"> - Align the whole text to the center. - </constant> - <constant name="VALIGN_BOTTOM" value="2" enum="VAlign"> - Align the whole text to the bottom. - </constant> - <constant name="VALIGN_FILL" value="3" enum="VAlign"> - Align the whole text by spreading the rows. - </constant> <constant name="AUTOWRAP_OFF" value="0" enum="AutowrapMode"> Autowrap is disabled. </constant> @@ -161,6 +142,21 @@ <constant name="OVERRUN_TRIM_WORD_ELLIPSIS" value="4" enum="OverrunBehavior"> Trims the text per word and adds an ellipsis to indicate that parts are hidden. </constant> + <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior"> + Trims text before the shaping. e.g, increasing [member visible_characters] value is visually identical to typing the text. + </constant> + <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior"> + Displays glyphs that are mapped to the first [member visible_characters] characters from the beginning of the text. + </constant> + <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior"> + Displays [member percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. + </constant> + <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> + Displays [member percent_visible] glyphs, starting from the left. + </constant> + <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> + Displays [member percent_visible] glyphs, starting from the right. + </constant> </constants> <theme_items> <theme_item name="font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 40e1057ed0..c3e3088d69 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -159,8 +159,8 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0"> - Text alignment as defined in the [enum Align] enum. + <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> + Text alignment as defined in the [enum HorizontalAlignment] enum. </member> <member name="caret_blink" type="bool" setter="set_caret_blink_enabled" getter="is_caret_blink_enabled" default="false"> If [code]true[/code], the caret (text cursor) blinks. @@ -292,18 +292,6 @@ </signal> </signals> <constants> - <constant name="ALIGN_LEFT" value="0" enum="Align"> - Aligns the text on the left-hand side of the [LineEdit]. - </constant> - <constant name="ALIGN_CENTER" value="1" enum="Align"> - Centers the text in the middle of the [LineEdit]. - </constant> - <constant name="ALIGN_RIGHT" value="2" enum="Align"> - Aligns the text on the right-hand side of the [LineEdit]. - </constant> - <constant name="ALIGN_FILL" value="3" enum="Align"> - Expand row to fit the [LineEdit]'s width. - </constant> <constant name="MENU_CUT" value="0" enum="MenuItems"> Cuts (copies and clears) the selected text. </constant> @@ -434,7 +422,7 @@ Texture for the clear button. See [member clear_button_enabled]. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - Background used when [LineEdit] has GUI focus. + Background used when [LineEdit] has GUI focus. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> Default background for the [LineEdit]. diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 17a9e13842..a20db4d7e9 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -94,7 +94,7 @@ Font size of the [LinkButton]'s text. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [LinkButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [StyleBox] used when the [LinkButton] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> </theme_items> </class> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index b0774d4cab..632b22c1de 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -80,7 +80,7 @@ [StyleBox] used when the [MenuButton] is disabled. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [MenuButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [StyleBox] used when the [MenuButton] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [MenuButton] is being hovered. diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml index 0f97cc1d0a..7bf40f860b 100644 --- a/doc/classes/MultiplayerReplicator.xml +++ b/doc/classes/MultiplayerReplicator.xml @@ -106,8 +106,8 @@ <argument index="3" name="custom_send" type="Callable" /> <argument index="4" name="custom_receive" type="Callable" /> <description> - Configures the MultiplayerReplicator to sync instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication at the desired [code]interval[/code] (in milliseconds). The specified [code]properties[/code] will be part of the state sync. You can optionally specify a [code]custom_send[/code] and a [code]custom_receive[/code] to override the default behaviour and customize the syncronization proecess. - Tip: You can use a custom property in the scene main script to return a customly optimized state representation (having a single property that returns a PackedByteArray is higly recommended when dealing with many instances). + Configures the MultiplayerReplicator to sync instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication at the desired [code]interval[/code] (in milliseconds). The specified [code]properties[/code] will be part of the state sync. You can optionally specify a [code]custom_send[/code] and a [code]custom_receive[/code] to override the default behaviour and customize the synchronization proecess. + Tip: You can use a custom property in the scene main script to return a customly optimized state representation (having a single property that returns a PackedByteArray is highly recommended when dealing with many instances). </description> </method> <method name="track"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 81b94c036d..753492ad34 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -186,7 +186,7 @@ <argument index="1" name="recursive" type="bool" default="true" /> <argument index="2" name="owned" type="bool" default="true" /> <description> - Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). + Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case-sensitive, but [code]"*"[/code] matches zero or more characters and [code]"?"[/code] matches any single character except [code]"."[/code]). Returns [code]null[/code] if no matching [Node] is found. [b]Note:[/b] It does not match against the full path, just against individual node names. If [code]owned[/code] is [code]true[/code], this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. [b]Note:[/b] As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using [method get_node] instead. To avoid using [method find_node] too often, consider caching the node reference into a variable. @@ -571,7 +571,8 @@ <description> Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost. If [code]keep_groups[/code] is [code]true[/code], the [code]node[/code] is added to the same groups that the replaced node is in. - Note that the replaced node is not automatically freed, so you either need to keep it in a variable for later use or free it using [method Object.free]. + [b]Note:[/b] The given node will become the new parent of any child nodes that the replaced node had. + [b]Note:[/b] The replaced node is not automatically freed, so you either need to keep it in a variable for later use or free it using [method Object.free]. </description> </method> <method name="request_ready"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index a5bd8e2768..1ed4b335ad 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -270,7 +270,60 @@ <method name="get_name" qualifiers="const"> <return type="String" /> <description> - Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"macOS"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code]. + Returns the name of the host OS. + On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] (Universal Windows Platform) if exported thereon. + On macOS, this is [code]"macOS"[/code]. + On Linux-based operating systems, this is [code]"Linux"[/code]. + On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback. + On Android, this is [code]"Android"[/code]. + On iOS, this is [code]"iOS"[/code]. + On the web, this is [code]"HTML5"[/code]. + [b]Note:[/b] Custom builds of the engine may support additional platforms, such as consoles, yielding other return values. + [codeblocks] + [gdscript] + match OS.get_name(): + "Windows", "UWP": + print("Windows") + "macOS": + print("macOS") + "Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD": + print("Linux/BSD") + "Android": + print("Android") + "iOS": + print("iOS") + "HTML5": + print("Web") + [/gdscript] + [csharp] + switch (OS.GetName()) + { + case "Windows": + case "UWP": + GD.Print("Windows"); + break; + case "macOS": + GD.Print("macOS"); + break; + case "Linux": + case "FreeBSD": + case "NetBSD": + case "OpenBSD" + case "BSD": + GD.Print("Linux/BSD"); + break; + case "Android": + GD.Print("Android"); + break; + case "iOS": + GD.Print("iOS"); + break; + case "HTML5": + GD.Print("Web"); + break; + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_process_id" qualifiers="const"> @@ -295,7 +348,7 @@ <method name="get_static_memory_usage" qualifiers="const"> <return type="int" /> <description> - Returns the amount of static memory being used by the program in bytes. + Returns the amount of static memory being used by the program in bytes (only works in debug). </description> </method> <method name="get_system_dir" qualifiers="const"> @@ -327,11 +380,13 @@ <return type="String" /> <description> Returns the absolute directory path where user data is written ([code]user://[/code]). - On Linux, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set. + On Windows, this is [code]%AppData%\Godot\app_userdata\[project_name][/code], or [code]%AppData%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%AppData%[/code] expands to [code]%UserProfile%\AppData\Roaming[/code]. On macOS, this is [code]~/Library/Application Support/Godot/app_userdata/[project_name][/code], or [code]~/Library/Application Support/[custom_name][/code] if [code]use_custom_user_dir[/code] is set. - On Windows, this is [code]%APPDATA%\Godot\app_userdata\[project_name][/code], or [code]%APPDATA%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%APPDATA%[/code] expands to [code]%USERPROFILE%\AppData\Roaming[/code]. - If the project name is empty, [code]user://[/code] falls back to [code]res://[/code]. - Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user data directory. + On Linux and BSD, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set. + On Android and iOS, this is a sandboxed directory in either internal or external storage, depending on the user's configuration. + On the web, this is a virtual directory managed by the browser. + If the project name is empty, [code][project_name][/code] falls back to [code][unnamed project][/code]. + Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user home directory. </description> </method> <method name="has_environment" qualifiers="const"> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 860e252805..e796cb2298 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -30,6 +30,7 @@ </description> <tutorials> <link title="When and how to avoid using nodes for everything">$DOCS_URL/tutorials/best_practices/node_alternatives.html</link> + <link title="Object notifications">$DOCS_URL/tutorials/best_practices/godot_notifications.html</link> </tutorials> <methods> <method name="_get" qualifiers="virtual"> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index d914b86a33..87561917f3 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -39,12 +39,6 @@ Clears all the items in the [OptionButton]. </description> </method> - <method name="get_item_count" qualifiers="const"> - <return type="int" /> - <description> - Returns the amount of items in the OptionButton, including separators. - </description> - </method> <method name="get_item_icon" qualifiers="const"> <return type="Texture2D" /> <argument index="0" name="idx" type="int" /> @@ -164,7 +158,10 @@ </methods> <members> <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" /> - <member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" /> + <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" /> + <member name="item_count" type="int" setter="set_item_count" getter="get_item_count" default="0"> + The number of items to select from. + </member> <member name="selected" type="int" setter="_select_int" getter="get_selected" default="-1"> The index of the currently selected item, or [code]-1[/code] if no item is selected. </member> @@ -228,7 +225,7 @@ [StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts). </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [StyleBox] used when the [OptionButton] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [OptionButton] is being hovered (for left-to-right layouts). diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 31640eb3d8..cefb74191e 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -107,36 +107,36 @@ <description> Waits for a packet to arrive on the bound address. See [method bind]. [b]Note:[/b] [method wait] can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: - [codeblocks] - [gdscript] - socket = PacketPeerUDP.new() - # Server - socket.set_dest_address("127.0.0.1", 789) - socket.put_packet("Time to stop".to_ascii()) + [codeblocks] + [gdscript] + socket = PacketPeerUDP.new() + # Server + socket.set_dest_address("127.0.0.1", 789) + socket.put_packet("Time to stop".to_ascii()) - # Client - while socket.wait() == OK: - var data = socket.get_packet().get_string_from_ascii() - if data == "Time to stop": - return - [/gdscript] - [csharp] - var socket = new PacketPeerUDP(); - // Server - socket.SetDestAddress("127.0.0.1", 789); - socket.PutPacket("Time to stop".ToAscii()); + # Client + while socket.wait() == OK: + var data = socket.get_packet().get_string_from_ascii() + if data == "Time to stop": + return + [/gdscript] + [csharp] + var socket = new PacketPeerUDP(); + // Server + socket.SetDestAddress("127.0.0.1", 789); + socket.PutPacket("Time to stop".ToAscii()); - // Client - while (socket.Wait() == OK) - { - string data = socket.GetPacket().GetStringFromASCII(); - if (data == "Time to stop") - { - return; - } - } - [/csharp] - [/codeblocks] + // Client + while (socket.Wait() == OK) + { + string data = socket.GetPacket().GetStringFromASCII(); + if (data == "Time to stop") + { + return; + } + } + [/csharp] + [/codeblocks] </description> </method> </methods> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index 8322d4474f..6cf0ea2a93 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -15,14 +15,14 @@ <return type="float" /> <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter" /> <description> - Return the maximum value range for the given prameter. + Returns the maximum value range for the given parameter. </description> </method> <method name="get_param_min" qualifiers="const"> <return type="float" /> <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter" /> <description> - Return the minimum value range for the given parameter. + Returns the minimum value range for the given parameter. </description> </method> <method name="get_param_texture" qualifiers="const"> @@ -83,13 +83,13 @@ Minimum angle. </member> <member name="angular_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> - Each particle's angular velocity will vary along this [CurveTexture]. + Each particle's angular velocity (rotation speed) will vary along this [CurveTexture] over its lifetime. </member> <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0"> - Maximum angular velocity. + Maximum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. </member> <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0"> - Minimum angular velocity. + Minimum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. </member> <member name="anim_offset_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's animation offset will vary along this [CurveTexture]. @@ -128,6 +128,9 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> Each particle's initial color. If the [GPUParticles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code]. </member> + <member name="color_initial_ramp" type="Texture2D" setter="set_color_initial_ramp" getter="get_color_initial_ramp"> + Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). + </member> <member name="color_ramp" type="Texture2D" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [GradientTexture1D] over its lifetime (multiplied with [member color]). </member> @@ -196,7 +199,7 @@ Minimum initial velocity. </member> <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> - Particle lifetime randomness ratio. The lifetime will be multipled by a value interpolated between [code]1.0[/code] and a random number less than one. For example a random ratio of [code]0.4[/code] would scale the original lifetime between [code]0.4-1.0[/code] of its original value. + Particle lifetime randomness ratio. The lifetime will be multiplied by a value interpolated between [code]1.0[/code] and a random number less than one. For example a random ratio of [code]0.4[/code] would scale the original lifetime between [code]0.4-1.0[/code] of its original value. </member> <member name="linear_accel_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture"> Each particle's linear acceleration will vary along this [CurveTexture]. diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml index c33bd930be..9921974c6e 100644 --- a/doc/classes/PhysicsDirectBodyState2D.xml +++ b/doc/classes/PhysicsDirectBodyState2D.xml @@ -11,26 +11,36 @@ <link title="Ray-casting">$DOCS_URL/tutorials/physics/ray-casting.html</link> </tutorials> <methods> - <method name="add_central_force"> + <method name="add_constant_central_force"> <return type="void" /> - <argument index="0" name="force" type="Vector2" /> + <argument index="0" name="force" type="Vector2" default="Vector2(0, 0)" /> <description> - Adds a constant directional force without affecting rotation. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]constant_force = Vector2(0, 0)[/code]. + This is equivalent to using [method add_constant_force] at the body's center of mass. </description> </method> - <method name="add_force"> + <method name="add_constant_force"> <return type="void" /> <argument index="0" name="force" type="Vector2" /> <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> - Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]constant_force = Vector2(0, 0)[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> - <method name="add_torque"> + <method name="add_constant_torque"> <return type="void" /> <argument index="0" name="torque" type="float" /> <description> - Adds a constant rotational force. + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]constant_torque = 0[/code]. + </description> + </method> + <method name="apply_central_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector2" default="Vector2(0, 0)" /> + <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method apply_force] at the body's center of mass. </description> </method> <method name="apply_central_impulse"> @@ -38,6 +48,17 @@ <argument index="0" name="impulse" type="Vector2" /> <description> Applies a directional impulse without affecting rotation. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + This is equivalent to using [method apply_impulse] at the body's center of mass. + </description> + </method> + <method name="apply_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector2" /> + <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="apply_impulse"> @@ -45,14 +66,38 @@ <argument index="0" name="impulse" type="Vector2" /> <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> - Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. + Applies a positioned impulse to the body. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="apply_torque"> + <return type="void" /> + <argument index="0" name="torque" type="float" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="apply_torque_impulse"> <return type="void" /> <argument index="0" name="impulse" type="float" /> <description> - Applies a rotational impulse to the body. + Applies a rotational impulse to the body without affecting the position. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + </description> + </method> + <method name="get_constant_force" qualifiers="const"> + <return type="Vector2" /> + <description> + Returns the body's total constant positional forces applied during each physics update. + See [method add_constant_force] and [method add_constant_central_force]. + </description> + </method> + <method name="get_constant_torque" qualifiers="const"> + <return type="float" /> + <description> + Returns the body's total constant rotational forces applied during each physics update. + See [method add_constant_torque]. </description> </method> <method name="get_contact_collider" qualifiers="const"> @@ -144,10 +189,26 @@ Calls the built-in force integration code. </description> </method> + <method name="set_constant_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector2" /> + <description> + Sets the body's total constant positional forces applied during each physics update. + See [method add_constant_force] and [method add_constant_central_force]. + </description> + </method> + <method name="set_constant_torque"> + <return type="void" /> + <argument index="0" name="torque" type="float" /> + <description> + Sets the body's total constant rotational forces applied during each physics update. + See [method add_constant_torque]. + </description> + </method> </methods> <members> <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity"> - The body's rotational velocity. + The body's rotational velocity in [i]radians[/i] per second. </member> <member name="center_of_mass" type="Vector2" setter="" getter="get_center_of_mass"> The body's center of mass position relative to the body's center in the global coordinate system. @@ -162,7 +223,7 @@ The inverse of the mass of the body. </member> <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity"> - The body's linear velocity. + The body's linear velocity in pixels per second. </member> <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping"> If [code]true[/code], this body is currently sleeping (not active). diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml index 7aa46dec2f..77c99c55b1 100644 --- a/doc/classes/PhysicsDirectBodyState3D.xml +++ b/doc/classes/PhysicsDirectBodyState3D.xml @@ -11,35 +11,54 @@ <link title="Ray-casting">$DOCS_URL/tutorials/physics/ray-casting.html</link> </tutorials> <methods> - <method name="add_central_force"> + <method name="add_constant_central_force"> <return type="void" /> <argument index="0" name="force" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Adds a constant directional force without affecting rotation. - This is equivalent to [code]add_force(force, Vector3(0,0,0))[/code]. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]constant_force = Vector3(0, 0, 0)[/code]. + This is equivalent to using [method add_constant_force] at the body's center of mass. </description> </method> - <method name="add_force"> + <method name="add_constant_force"> <return type="void" /> <argument index="0" name="force" type="Vector3" /> <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]constant_force = Vector3(0, 0, 0)[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> - <method name="add_torque"> + <method name="add_constant_torque"> <return type="void" /> <argument index="0" name="torque" type="Vector3" /> <description> - Adds a constant rotational force without affecting position. + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]constant_torque = Vector3(0, 0, 0)[/code]. + </description> + </method> + <method name="apply_central_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" default="Vector3(0, 0, 0)" /> + <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method apply_force] at the body's center of mass. </description> </method> <method name="apply_central_impulse"> <return type="void" /> <argument index="0" name="impulse" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Applies a single directional impulse without affecting rotation. - This is equivalent to [code]apply_impulse(Vector3(0, 0, 0), impulse)[/code]. + Applies a directional impulse without affecting rotation. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + This is equivalent to using [method apply_impulse] at the body's center of mass. + </description> + </method> + <method name="apply_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="apply_impulse"> @@ -47,14 +66,38 @@ <argument index="0" name="impulse" type="Vector3" /> <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. + Applies a positioned impulse to the body. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="apply_torque"> + <return type="void" /> + <argument index="0" name="torque" type="Vector3" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="apply_torque_impulse"> <return type="void" /> <argument index="0" name="impulse" type="Vector3" /> <description> - Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector [code]j[/code] passed as parameter. + Applies a rotational impulse to the body without affecting the position. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + </description> + </method> + <method name="get_constant_force" qualifiers="const"> + <return type="Vector3" /> + <description> + Returns the body's total constant positional forces applied during each physics update. + See [method add_constant_force] and [method add_constant_central_force]. + </description> + </method> + <method name="get_constant_torque" qualifiers="const"> + <return type="Vector3" /> + <description> + Returns the body's total constant rotational forces applied during each physics update. + See [method add_constant_torque]. </description> </method> <method name="get_contact_collider" qualifiers="const"> @@ -153,10 +196,26 @@ Calls the built-in force integration code. </description> </method> + <method name="set_constant_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <description> + Sets the body's total constant positional forces applied during each physics update. + See [method add_constant_force] and [method add_constant_central_force]. + </description> + </method> + <method name="set_constant_torque"> + <return type="void" /> + <argument index="0" name="torque" type="Vector3" /> + <description> + Sets the body's total constant rotational forces applied during each physics update. + See [method add_constant_torque]. + </description> + </method> </methods> <members> <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity"> - The body's rotational velocity. + The body's rotational velocity in [i]radians[/i] per second. </member> <member name="center_of_mass" type="Vector3" setter="" getter="get_center_of_mass"> The body's center of mass position relative to the body's center in the global coordinate system. @@ -171,7 +230,7 @@ The inverse of the mass of the body. </member> <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity"> - The body's linear velocity. + The body's linear velocity in units per second. </member> <member name="principal_inertia_axes" type="Basis" setter="" getter="get_principal_inertia_axes"> </member> diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 556e2dae85..624f5e7b17 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -208,28 +208,39 @@ Sets the transform matrix for an area. </description> </method> - <method name="body_add_central_force"> + <method name="body_add_collision_exception"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="force" type="Vector2" /> + <argument index="1" name="excepted_body" type="RID" /> <description> + Adds a body to the list of bodies exempt from collisions. </description> </method> - <method name="body_add_collision_exception"> + <method name="body_add_constant_central_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="excepted_body" type="RID" /> + <argument index="1" name="force" type="Vector2" /> <description> - Adds a body to the list of bodies exempt from collisions. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector2(0, 0))[/code]. + This is equivalent to using [method body_add_constant_force] at the body's center of mass. </description> </method> - <method name="body_add_force"> + <method name="body_add_constant_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> <argument index="1" name="force" type="Vector2" /> <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> - Adds a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied. + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector2(0, 0))[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="body_add_constant_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="float" /> + <description> + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]body_set_constant_torque(body, 0)[/code]. </description> </method> <method name="body_add_shape"> @@ -242,11 +253,13 @@ Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. </description> </method> - <method name="body_add_torque"> + <method name="body_apply_central_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="torque" type="float" /> + <argument index="1" name="force" type="Vector2" /> <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method body_apply_force] at the body's center of mass. </description> </method> <method name="body_apply_central_impulse"> @@ -254,6 +267,19 @@ <argument index="0" name="body" type="RID" /> <argument index="1" name="impulse" type="Vector2" /> <description> + Applies a directional impulse without affecting rotation. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + This is equivalent to using [method body_apply_impulse] at the body's center of mass. + </description> + </method> + <method name="body_apply_force"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector2" /> + <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="body_apply_impulse"> @@ -262,7 +288,17 @@ <argument index="1" name="impulse" type="Vector2" /> <argument index="2" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> - Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates. + Applies a positioned impulse to the body. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="body_apply_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="float" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="body_apply_torque_impulse"> @@ -270,6 +306,8 @@ <argument index="0" name="body" type="RID" /> <argument index="1" name="impulse" type="float" /> <description> + Applies a rotational impulse to the body without affecting the position. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). </description> </method> <method name="body_attach_canvas_instance_id"> @@ -320,6 +358,22 @@ Returns the physics layer or layers a body can collide with. </description> </method> + <method name="body_get_constant_force" qualifiers="const"> + <return type="Vector2" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the body's total constant positional forces applied during each physics update. + See [method body_add_constant_force] and [method body_add_constant_central_force]. + </description> + </method> + <method name="body_get_constant_torque" qualifiers="const"> + <return type="float" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the body's total constant rotational forces applied during each physics update. + See [method body_add_constant_torque]. + </description> + </method> <method name="body_get_continuous_collision_detection_mode" qualifiers="const"> <return type="int" enum="PhysicsServer2D.CCDMode" /> <argument index="0" name="body" type="RID" /> @@ -455,6 +509,24 @@ Sets the physics layer or layers a body can collide with. </description> </method> + <method name="body_set_constant_force"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector2" /> + <description> + Sets the body's total constant positional forces applied during each physics update. + See [method body_add_constant_force] and [method body_add_constant_central_force]. + </description> + </method> + <method name="body_set_constant_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="float" /> + <description> + Sets the body's total constant rotational forces applied during each physics update. + See [method body_add_constant_torque]. + </description> + </method> <method name="body_set_continuous_collision_detection_mode"> <return type="void" /> <argument index="0" name="body" type="RID" /> @@ -789,7 +861,7 @@ Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1" enum="SpaceParameter"> - Constant to set/get the maximum distance a shape can be from another before they are considered separated. + Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION" value="2" enum="SpaceParameter"> Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 027c593de3..cb90d84238 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -202,27 +202,39 @@ Sets the transform matrix for an area. </description> </method> - <method name="body_add_central_force"> + <method name="body_add_collision_exception"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="force" type="Vector3" /> + <argument index="1" name="excepted_body" type="RID" /> <description> + Adds a body to the list of bodies exempt from collisions. </description> </method> - <method name="body_add_collision_exception"> + <method name="body_add_constant_central_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="excepted_body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> <description> - Adds a body to the list of bodies exempt from collisions. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code]. + This is equivalent to using [method body_add_constant_force] at the body's center of mass. </description> </method> - <method name="body_add_force"> + <method name="body_add_constant_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> <argument index="1" name="force" type="Vector3" /> <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]body_set_constant_force(body, Vector3(0, 0, 0))[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="body_add_constant_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]body_set_constant_torque(body, Vector3(0, 0, 0))[/code]. </description> </method> <method name="body_add_shape"> @@ -235,11 +247,13 @@ Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. </description> </method> - <method name="body_add_torque"> + <method name="body_apply_central_force"> <return type="void" /> <argument index="0" name="body" type="RID" /> - <argument index="1" name="torque" type="Vector3" /> + <argument index="1" name="force" type="Vector3" /> <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method body_apply_force] at the body's center of mass. </description> </method> <method name="body_apply_central_impulse"> @@ -247,6 +261,19 @@ <argument index="0" name="body" type="RID" /> <argument index="1" name="impulse" type="Vector3" /> <description> + Applies a directional impulse without affecting rotation. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + This is equivalent to using [method body_apply_impulse] at the body's center of mass. + </description> + </method> + <method name="body_apply_force"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="body_apply_impulse"> @@ -255,7 +282,17 @@ <argument index="1" name="impulse" type="Vector3" /> <argument index="2" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Gives the body a push at a [code]position[/code] in the direction of the [code]impulse[/code]. + Applies a positioned impulse to the body. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="body_apply_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="body_apply_torque_impulse"> @@ -263,7 +300,8 @@ <argument index="0" name="body" type="RID" /> <argument index="1" name="impulse" type="Vector3" /> <description> - Gives the body a push to rotate it. + Applies a rotational impulse to the body without affecting the position. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). </description> </method> <method name="body_attach_object_instance_id"> @@ -298,7 +336,22 @@ <argument index="0" name="body" type="RID" /> <description> Returns the physics layer or layers a body can collide with. -- + </description> + </method> + <method name="body_get_constant_force" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the body's total constant positional forces applied during each physics update. + See [method body_add_constant_force] and [method body_add_constant_central_force]. + </description> + </method> + <method name="body_get_constant_torque" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the body's total constant rotational forces applied during each physics update. + See [method body_add_constant_torque]. </description> </method> <method name="body_get_direct_state"> @@ -452,6 +505,24 @@ Sets the physics layer or layers a body can collide with. </description> </method> + <method name="body_set_constant_force"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="force" type="Vector3" /> + <description> + Sets the body's total constant positional forces applied during each physics update. + See [method body_add_constant_force] and [method body_add_constant_central_force]. + </description> + </method> + <method name="body_set_constant_torque"> + <return type="void" /> + <argument index="0" name="body" type="RID" /> + <argument index="1" name="torque" type="Vector3" /> + <description> + Sets the body's total constant rotational forces applied during each physics update. + See [method body_add_constant_torque]. + </description> + </method> <method name="body_set_enable_continuous_collision_detection"> <return type="void" /> <argument index="0" name="body" type="RID" /> @@ -1333,7 +1404,7 @@ Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1" enum="SpaceParameter"> - Constant to set/get the maximum distance a shape can be from another before they are considered separated. + Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION" value="2" enum="SpaceParameter"> Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. @@ -1350,12 +1421,7 @@ <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="6" enum="SpaceParameter"> Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. </constant> - <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO" value="7" enum="SpaceParameter"> - </constant> - <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="8" enum="SpaceParameter"> - Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. - </constant> - <constant name="SPACE_PARAM_SOLVER_ITERATIONS" value="9" enum="SpaceParameter"> + <constant name="SPACE_PARAM_SOLVER_ITERATIONS" value="7" enum="SpaceParameter"> Constant to set/get the number of solver iterations for contacts and constraints. The greater the amount of iterations, the more accurate the collisions and constraints will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. </constant> <constant name="BODY_AXIS_LINEAR_X" value="1" enum="BodyAxis"> diff --git a/doc/classes/PhysicsTestMotionResult2D.xml b/doc/classes/PhysicsTestMotionResult2D.xml index 355365cf25..060641caff 100644 --- a/doc/classes/PhysicsTestMotionResult2D.xml +++ b/doc/classes/PhysicsTestMotionResult2D.xml @@ -12,55 +12,55 @@ <method name="get_collider" qualifiers="const"> <return type="Object" /> <description> - Returns the colliding body's attached [Object], if a collision occured. + Returns the colliding body's attached [Object], if a collision occurred. </description> </method> <method name="get_collider_id" qualifiers="const"> <return type="int" /> <description> - Returns the unique instance ID of the colliding body's attached [Object], if a collision occured. See [method Object.get_instance_id]. + Returns the unique instance ID of the colliding body's attached [Object], if a collision occurred. See [method Object.get_instance_id]. </description> </method> <method name="get_collider_rid" qualifiers="const"> <return type="RID" /> <description> - Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occured. + Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occurred. </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int" /> <description> - Returns the colliding body's shape index, if a collision occured. See [CollisionObject2D]. + Returns the colliding body's shape index, if a collision occurred. See [CollisionObject2D]. </description> </method> <method name="get_collider_velocity" qualifiers="const"> <return type="Vector2" /> <description> - Returns the colliding body's velocity, if a collision occured. + Returns the colliding body's velocity, if a collision occurred. </description> </method> <method name="get_collision_depth" qualifiers="const"> <return type="float" /> <description> - Returns the length of overlap along the collision normal, if a collision occured. + Returns the length of overlap along the collision normal, if a collision occurred. </description> </method> <method name="get_collision_local_shape" qualifiers="const"> <return type="int" /> <description> - Returns the moving object's colliding shape, if a collision occured. + Returns the moving object's colliding shape, if a collision occurred. </description> </method> <method name="get_collision_normal" qualifiers="const"> <return type="Vector2" /> <description> - Returns the colliding body's shape's normal at the point of collision, if a collision occured. + Returns the colliding body's shape's normal at the point of collision, if a collision occurred. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector2" /> <description> - Returns the point of collision in global coordinates, if a collision occured. + Returns the point of collision in global coordinates, if a collision occurred. </description> </method> <method name="get_collision_safe_fraction" qualifiers="const"> @@ -72,7 +72,7 @@ <method name="get_collision_unsafe_fraction" qualifiers="const"> <return type="float" /> <description> - Returns the minimum fraction of the motion needed to collide, if a collision occured, between [code]0[/code] and [code]1[/code]. + Returns the minimum fraction of the motion needed to collide, if a collision occurred, between [code]0[/code] and [code]1[/code]. </description> </method> <method name="get_remainder" qualifiers="const"> diff --git a/doc/classes/PhysicsTestMotionResult3D.xml b/doc/classes/PhysicsTestMotionResult3D.xml index 282c140568..96029937da 100644 --- a/doc/classes/PhysicsTestMotionResult3D.xml +++ b/doc/classes/PhysicsTestMotionResult3D.xml @@ -13,35 +13,35 @@ <return type="Object" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occured. + Returns the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collider_id" qualifiers="const"> <return type="int" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occured. See [method Object.get_instance_id]. + Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occurred. See [method Object.get_instance_id]. </description> </method> <method name="get_collider_rid" qualifiers="const"> <return type="RID" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default), if a collision occured. + Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occured. See [CollisionObject3D]. + Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occurred. See [CollisionObject3D]. </description> </method> <method name="get_collider_velocity" qualifiers="const"> <return type="Vector3" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occured. + Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collision_count" qualifiers="const"> @@ -54,28 +54,28 @@ <return type="float" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occured. + Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collision_local_shape" qualifiers="const"> <return type="int" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occured. + Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collision_normal" qualifiers="const"> <return type="Vector3" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default), if a collision occured. + Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector3" /> <argument index="0" name="collision_index" type="int" default="0" /> <description> - Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occured. + Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occurred. </description> </method> <method name="get_collision_safe_fraction" qualifiers="const"> @@ -87,7 +87,7 @@ <method name="get_collision_unsafe_fraction" qualifiers="const"> <return type="float" /> <description> - Returns the minimum fraction of the motion needed to collide, if a collision occured, between [code]0[/code] and [code]1[/code]. + Returns the minimum fraction of the motion needed to collide, if a collision occurred, between [code]0[/code] and [code]1[/code]. </description> </method> <method name="get_remainder" qualifiers="const"> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 0307277da5..b45f62394d 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -107,6 +107,7 @@ <description> Adds a new item with text [code]label[/code]. An [code]id[/code] can optionally be provided, as well as an accelerator ([code]accel[/code]). If no [code]id[/code] is provided, one will be created from the index. If no [code]accel[/code] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators. + [b]Note:[/b] The provided [code]id[/code] is used only in [signal id_pressed] and [signal id_focused] signals. It's not related to the [code]index[/code] arguments in e.g. [method set_item_checked]. </description> </method> <method name="add_multistate_item"> @@ -181,7 +182,7 @@ </method> <method name="clear_item_opentype_features"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Removes all OpenType features form the item's text. </description> @@ -194,49 +195,49 @@ </method> <method name="get_item_accelerator" qualifiers="const"> <return type="int" enum="Key" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the accelerator of the item at index [code]idx[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + Returns the accelerator of the item at the given [code]index[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. </description> </method> <method name="get_item_icon" qualifiers="const"> <return type="Texture2D" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the icon of the item at index [code]idx[/code]. + Returns the icon of the item at the given [code]index[/code]. </description> </method> <method name="get_item_id" qualifiers="const"> <return type="int" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the id of the item at index [code]idx[/code]. [code]id[/code] can be manually assigned, while index can not. + Returns the id of the item at the given [code]index[/code]. [code]id[/code] can be manually assigned, while index can not. </description> </method> <method name="get_item_index" qualifiers="const"> <return type="int" /> <argument index="0" name="id" type="int" /> <description> - Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine and can not be set manually. </description> </method> <method name="get_item_language" qualifiers="const"> <return type="String" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Returns item's text language code. </description> </method> <method name="get_item_metadata" qualifiers="const"> <return type="Variant" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items. </description> </method> <method name="get_item_opentype_feature" qualifiers="const"> <return type="int" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="tag" type="String" /> <description> Returns OpenType feature [code]tag[/code] of the item's text. @@ -244,160 +245,161 @@ </method> <method name="get_item_shortcut" qualifiers="const"> <return type="Shortcut" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the [Shortcut] associated with the specified [code]idx[/code] item. + Returns the [Shortcut] associated with the item at the given [code]index[/code]. </description> </method> <method name="get_item_submenu" qualifiers="const"> <return type="String" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the submenu name of the item at index [code]idx[/code]. See [method add_submenu_item] for more info on how to add a submenu. + Returns the submenu name of the item at the given [code]index[/code]. See [method add_submenu_item] for more info on how to add a submenu. </description> </method> <method name="get_item_text" qualifiers="const"> <return type="String" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the text of the item at index [code]idx[/code]. + Returns the text of the item at the given [code]index[/code]. </description> </method> <method name="get_item_text_direction" qualifiers="const"> <return type="int" enum="Control.TextDirection" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Returns item's text base writing direction. </description> </method> <method name="get_item_tooltip" qualifiers="const"> <return type="String" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the tooltip associated with the specified index index [code]idx[/code]. + Returns the tooltip associated with the item at the given [code]index[/code]. </description> </method> <method name="is_item_checkable" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns [code]true[/code] if the item at index [code]idx[/code] is checkable in some way, i.e. if it has a checkbox or radio button. + Returns [code]true[/code] if the item at the given [code]index[/code] is checkable in some way, i.e. if it has a checkbox or radio button. [b]Note:[/b] Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually. </description> </method> <method name="is_item_checked" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns [code]true[/code] if the item at index [code]idx[/code] is checked. + Returns [code]true[/code] if the item at the given [code]index[/code] is checked. </description> </method> <method name="is_item_disabled" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. When it is disabled it can't be selected, or its action invoked. + Returns [code]true[/code] if the item at the given [code]index[/code] is disabled. When it is disabled it can't be selected, or its action invoked. See [method set_item_disabled] for more info on how to disable an item. </description> </method> <method name="is_item_radio_checkable" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns [code]true[/code] if the item at index [code]idx[/code] has radio button-style checkability. + Returns [code]true[/code] if the item at the given [code]index[/code] has radio button-style checkability. [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. </description> </method> <method name="is_item_separator" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Returns [code]true[/code] if the item is a separator. If it is, it will be displayed as a line. See [method add_separator] for more info on how to add a separator. </description> </method> <method name="is_item_shortcut_disabled" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Returns [code]true[/code] if the specified item's shortcut is disabled. </description> </method> <method name="remove_item"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Removes the item at index [code]idx[/code] from the menu. + Removes the item at the given [code]index[/code] from the menu. [b]Note:[/b] The indices of items after the removed item will be shifted by one. </description> </method> <method name="set_item_accelerator"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="accel" type="int" enum="Key" /> <description> - Sets the accelerator of the item at index [code]idx[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + Sets the accelerator of the item at the given [code]index[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. </description> </method> <method name="set_item_as_checkable"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="enable" type="bool" /> <description> - Sets whether the item at index [code]idx[/code] has a checkbox. If [code]false[/code], sets the type of the item to plain text. + Sets whether the item at the given [code]index[/code] has a checkbox. If [code]false[/code], sets the type of the item to plain text. [b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. </description> </method> <method name="set_item_as_radio_checkable"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="enable" type="bool" /> <description> - Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text. + Sets the type of the item at the given [code]index[/code] to radio button. If [code]false[/code], sets the type of the item to plain text. </description> </method> <method name="set_item_as_separator"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="enable" type="bool" /> <description> - Mark the item at index [code]idx[/code] as a separator, which means that it would be displayed as a line. If [code]false[/code], sets the type of the item to plain text. + Mark the item at the given [code]index[/code] as a separator, which means that it would be displayed as a line. If [code]false[/code], sets the type of the item to plain text. </description> </method> <method name="set_item_checked"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="checked" type="bool" /> <description> - Sets the checkstate status of the item at index [code]idx[/code]. + Sets the checkstate status of the item at the given [code]index[/code]. </description> </method> <method name="set_item_disabled"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="disabled" type="bool" /> <description> - Enables/disables the item at index [code]idx[/code]. When it is disabled, it can't be selected and its action can't be invoked. + Enables/disables the item at the given [code]index[/code]. When it is disabled, it can't be selected and its action can't be invoked. </description> </method> <method name="set_item_icon"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="icon" type="Texture2D" /> <description> - Replaces the [Texture2D] icon of the specified [code]idx[/code]. + Replaces the [Texture2D] icon of the item at the given [code]index[/code]. </description> </method> <method name="set_item_id"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="id" type="int" /> <description> - Sets the [code]id[/code] of the item at index [code]idx[/code]. + Sets the [code]id[/code] of the item at the given [code]index[/code]. + The [code]id[/code] is used in [signal id_pressed] and [signal id_focused] signals. </description> </method> <method name="set_item_language"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="language" type="String" /> <description> Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. @@ -405,7 +407,7 @@ </method> <method name="set_item_metadata"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="metadata" type="Variant" /> <description> Sets the metadata of an item, which may be of any type. You can later get it with [method get_item_metadata], which provides a simple way of assigning context data to items. @@ -413,7 +415,7 @@ </method> <method name="set_item_multistate"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="state" type="int" /> <description> Sets the state of a multistate item. See [method add_multistate_item] for details. @@ -421,7 +423,7 @@ </method> <method name="set_item_opentype_feature"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="tag" type="String" /> <argument index="2" name="value" type="int" /> <description> @@ -430,40 +432,40 @@ </method> <method name="set_item_shortcut"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="shortcut" type="Shortcut" /> <argument index="2" name="global" type="bool" default="false" /> <description> - Sets a [Shortcut] for the specified item [code]idx[/code]. + Sets a [Shortcut] for the item at the given [code]index[/code]. </description> </method> <method name="set_item_shortcut_disabled"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="disabled" type="bool" /> <description> - Disables the [Shortcut] of the specified index [code]idx[/code]. + Disables the [Shortcut] of the item at the given [code]index[/code]. </description> </method> <method name="set_item_submenu"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="submenu" type="String" /> <description> - Sets the submenu of the item at index [code]idx[/code]. The submenu is the name of a child [PopupMenu] node that would be shown when the item is clicked. + Sets the submenu of the item at the given [code]index[/code]. The submenu is the name of a child [PopupMenu] node that would be shown when the item is clicked. </description> </method> <method name="set_item_text"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="text" type="String" /> <description> - Sets the text of the item at index [code]idx[/code]. + Sets the text of the item at the given [code]index[/code]. </description> </method> <method name="set_item_text_direction"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="direction" type="int" enum="Control.TextDirection" /> <description> Sets item's text base writing direction. @@ -471,22 +473,22 @@ </method> <method name="set_item_tooltip"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <argument index="1" name="tooltip" type="String" /> <description> - Sets the [String] tooltip of the item at the specified index [code]idx[/code]. + Sets the [String] tooltip of the item at the given [code]index[/code]. </description> </method> <method name="toggle_item_checked"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> - Toggles the check state of the item of the specified index [code]idx[/code]. + Toggles the check state of the item at the given [code]index[/code]. </description> </method> <method name="toggle_item_multistate"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <argument index="0" name="index" type="int" /> <description> Cycle to the next state of a multistate item. See [method add_multistate_item] for details. </description> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 6d63f56f1c..e9b3b887ae 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -34,7 +34,7 @@ </member> <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false"> If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. - This gives the same result as using [constant BaseMaterial3D.CULL_BACK] in [member BaseMaterial3D.cull_mode]. + This gives the same result as using [constant BaseMaterial3D.CULL_FRONT] in [member BaseMaterial3D.cull_mode]. </member> <member name="material" type="Material" setter="set_material" getter="get_material"> The current [Material] of the primitive mesh. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index ce9f41410a..2065c59d18 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1421,6 +1421,26 @@ <member name="physics/2d/sleep_threshold_linear" type="float" setter="" getter="" default="2.0"> Threshold linear velocity under which a 2D physics body will be considered inactive. See [constant PhysicsServer2D.SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD]. </member> + <member name="physics/2d/solver/contact_max_allowed_penetration" type="float" setter="" getter="" default="0.3"> + Maximum distance a shape can penetrate another shape before it is considered a collision. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION]. + </member> + <member name="physics/2d/solver/contact_max_separation" type="float" setter="" getter="" default="1.5"> + Maximum distance a shape can be from another before they are considered separated and the contact is discarded. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_MAX_SEPARATION]. + </member> + <member name="physics/2d/solver/contact_recycle_radius" type="float" setter="" getter="" default="1.0"> + Maximum distance a pair of bodies has to move before their collision status has to be recalculated. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_RECYCLE_RADIUS]. + </member> + <member name="physics/2d/solver/default_constraint_bias" type="float" setter="" getter="" default="0.2"> + Default solver bias for all physics constraints. Defines how much bodies react to enforce constraints. See [constant PhysicsServer2D.SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS]. + Individual constraints can have a specific bias value (see [member Joint2D.bias]). + </member> + <member name="physics/2d/solver/default_contact_bias" type="float" setter="" getter="" default="0.8"> + Default solver bias for all physics contacts. Defines how much bodies react to enforce contact separation. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_DEFAULT_BIAS]. + Individual shapes can have a specific bias value (see [member Shape2D.custom_solver_bias]). + </member> + <member name="physics/2d/solver/solver_iterations" type="int" setter="" getter="" default="16"> + Number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer2D.SPACE_PARAM_SOLVER_ITERATIONS]. + </member> <member name="physics/2d/time_before_sleep" type="float" setter="" getter="" default="0.5"> Time (in seconds) of inactivity before which a 2D physics body will put to sleep. See [constant PhysicsServer2D.SPACE_PARAM_BODY_TIME_TO_SLEEP]. </member> @@ -1468,10 +1488,29 @@ Sets whether 3D physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. </member> <member name="physics/3d/sleep_threshold_angular" type="float" setter="" getter="" default="0.139626"> + Threshold angular velocity under which a 3D physics body will be considered inactive. See [constant PhysicsServer3D.SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD]. </member> <member name="physics/3d/sleep_threshold_linear" type="float" setter="" getter="" default="0.1"> + Threshold linear velocity under which a 3D physics body will be considered inactive. See [constant PhysicsServer3D.SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD]. + </member> + <member name="physics/3d/solver/contact_max_allowed_penetration" type="float" setter="" getter="" default="0.01"> + Maximum distance a shape can penetrate another shape before it is considered a collision. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION]. + </member> + <member name="physics/3d/solver/contact_max_separation" type="float" setter="" getter="" default="0.05"> + Maximum distance a shape can be from another before they are considered separated and the contact is discarded. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_MAX_SEPARATION]. + </member> + <member name="physics/3d/solver/contact_recycle_radius" type="float" setter="" getter="" default="0.01"> + Maximum distance a pair of bodies has to move before their collision status has to be recalculated. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_RECYCLE_RADIUS]. + </member> + <member name="physics/3d/solver/default_contact_bias" type="float" setter="" getter="" default="0.8"> + Default solver bias for all physics contacts. Defines how much bodies react to enforce contact separation. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_DEFAULT_BIAS]. + Individual shapes can have a specific bias value (see [member Shape3D.custom_solver_bias]). + </member> + <member name="physics/3d/solver/solver_iterations" type="int" setter="" getter="" default="16"> + Number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer3D.SPACE_PARAM_SOLVER_ITERATIONS]. </member> <member name="physics/3d/time_before_sleep" type="float" setter="" getter="" default="0.5"> + Time (in seconds) of inactivity before which a 3D physics body will put to sleep. See [constant PhysicsServer3D.SPACE_PARAM_BODY_TIME_TO_SLEEP]. </member> <member name="physics/common/enable_object_picking" type="bool" setter="" getter="" default="true"> Enables [member Viewport.physics_object_picking] on the root viewport. @@ -1558,11 +1597,9 @@ <member name="rendering/camera/depth_of_field/depth_of_field_use_jitter" type="bool" setter="" getter="" default="false"> If [code]true[/code], jitters DOF samples to make effect slightly blurrier and hide lines created from low sample rates. This can result in a slightly grainy appearance when used with a low number of samples. </member> - <member name="rendering/driver/depth_prepass/disable_for_vendors" type="String" setter="" getter="" default=""PowerVR,Mali,Adreno,Apple""> - Disables depth pre-pass for some GPU vendors (usually mobile), as their architecture already does this. - </member> <member name="rendering/driver/depth_prepass/enable" type="bool" setter="" getter="" default="true"> - If [code]true[/code], performs a previous depth pass before rendering materials. This increases performance in scenes with high overdraw, when complex materials and lighting are used. + If [code]true[/code], performs a previous depth pass before rendering 3D materials. This increases performance significantly in scenes with high overdraw, when complex materials and lighting are used. However, in scenes with few occluded surfaces, the depth prepass may reduce performance. If your game is viewed from a fixed angle that makes it easy to avoid overdraw (such as top-down or side-scrolling perspective), consider disabling the depth prepass to improve performance. This setting can be changed at run-time to optimize performance depending on the scene currently being viewed. + [b]Note:[/b] Only supported when using the Vulkan Clustered backend (not Vulkan Mobile or OpenGL). When using Vulkan Mobile or OpenGL, there is no depth prepass performed. </member> <member name="rendering/driver/driver_name" type="String" setter="" getter="" default=""vulkan""> The video driver to use. @@ -1613,6 +1650,24 @@ <member name="rendering/environment/ssao/quality" type="int" setter="" getter="" default="2"> Sets the quality of the screen-space ambient occlusion effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to [code]ULTRA[/code] will use the [member rendering/environment/ssao/adaptive_target] setting. </member> + <member name="rendering/environment/ssil/adaptive_target" type="float" setter="" getter="" default="0.5"> + Quality target to use when [member rendering/environment/ssil/quality] is set to [code]ULTRA[/code]. A value of [code]0.0[/code] provides a quality and speed similar to [code]MEDIUM[/code] while a value of [code]1.0[/code] provides much higher quality than any of the other settings at the cost of performance. When using the adaptive target, the performance cost scales with the complexity of the scene. + </member> + <member name="rendering/environment/ssil/blur_passes" type="int" setter="" getter="" default="4"> + Number of blur passes to use when computing screen-space indirect lighting. A higher number will result in a smoother look, but will be slower to compute and will have less high-frequency detail. + </member> + <member name="rendering/environment/ssil/fadeout_from" type="float" setter="" getter="" default="50.0"> + Distance at which the screen-space indirect lighting effect starts to fade out. Use this hide screen-space indirect lighting at great distances. + </member> + <member name="rendering/environment/ssil/fadeout_to" type="float" setter="" getter="" default="300.0"> + Distance at which the screen-space indirect lighting is fully faded out. Use this hide screen-space indirect lighting at great distances. + </member> + <member name="rendering/environment/ssil/half_size" type="bool" setter="" getter="" default="true"> + If [code]true[/code], screen-space indirect lighting will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details and may result in some objects appearing to glow at their edges. + </member> + <member name="rendering/environment/ssil/quality" type="int" setter="" getter="" default="2"> + Sets the quality of the screen-space indirect lighting effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to [code]ULTRA[/code] will use the [member rendering/environment/ssil/adaptive_target] setting. + </member> <member name="rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale" type="float" setter="" getter="" default="0.01"> Scales the depth over which the subsurface scattering effect is applied. A high value may allow light to scatter into a part of the mesh or another mesh that is close in screen space but far in depth. </member> @@ -1682,6 +1737,9 @@ <member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600"> </member> <member name="rendering/mesh_lod/lod_change/threshold_pixels" type="float" setter="" getter="" default="1.0"> + The automatic LOD bias to use for meshes rendered within the [ReflectionProbe]. Higher values will use less detailed versions of meshes that have LOD variations generated. If set to [code]0.0[/code], automatic LOD is disabled. Increase [member rendering/mesh_lod/lod_change/threshold_pixels] to improve performance at the cost of geometry detail. + [b]Note:[/b] [member rendering/mesh_lod/lod_change/threshold_pixels] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD). + [b]Note:[/b] This property is only read when the project starts. To adjust the automatic LOD threshold at runtime, set [member Viewport.mesh_lod_threshold] on the root [Viewport]. </member> <member name="rendering/occlusion_culling/bvh_build_quality" type="int" setter="" getter="" default="2"> </member> diff --git a/doc/classes/RDFramebufferPass.xml b/doc/classes/RDFramebufferPass.xml index 4469a5d447..33e4248983 100644 --- a/doc/classes/RDFramebufferPass.xml +++ b/doc/classes/RDFramebufferPass.xml @@ -5,7 +5,7 @@ </brief_description> <description> This class contains the list of attachment descriptions for a framebuffer pass. Each points with an index to a previously supplied list of texture attachments. - Multipass framebuffers can optimize some configurations in mobile, on desktop they provide little to no advantage. + Multipass framebuffers can optimize some configurations in mobile, on desktop they provide little to no advantage. </description> <tutorials> </tutorials> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index 8bf8534334..5d207c0db7 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -1,33 +1,39 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ReflectionProbe" inherits="VisualInstance3D" version="4.0"> <brief_description> - Captures its surroundings to create reflections. + Captures its surroundings to create fast, accurate reflections from a given point. </brief_description> <description> Captures its surroundings as a cubemap, and stores versions of it with increasing levels of blur to simulate different material roughnesses. - The [ReflectionProbe] is used to create high-quality reflections at the cost of performance. It can be combined with [VoxelGI]s and Screen Space Reflections to achieve high quality reflections. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them. + The [ReflectionProbe] is used to create high-quality reflections at a low performance cost (when [member update_mode] is [constant UPDATE_ONCE]). [ReflectionProbe]s can be blended together and with the rest of the scene smoothly. [ReflectionProbe]s can also be combined with [VoxelGI], SDFGI ([member Environment.sdfgi_enabled]) and screen-space reflections ([member Environment.ss_reflections_enabled]) to get more accurate reflections in specific areas. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is. + [b]Note:[/b] Unlike [VoxelGI] and SDFGI, [ReflectionProbe]s only source their environment from a [WorldEnvironment] node. If you specify an [Environment] resource within a [Camera3D] node, it will be ignored by the [ReflectionProbe]. This can lead to incorrect lighting within the [ReflectionProbe]. </description> <tutorials> <link title="Reflection probes">$DOCS_URL/tutorials/3d/reflection_probes.html</link> </tutorials> <members> <member name="ambient_color" type="Color" setter="set_ambient_color" getter="get_ambient_color" default="Color(0, 0, 0, 1)"> + The custom ambient color to use within the [ReflectionProbe]'s [member extents]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. </member> <member name="ambient_color_energy" type="float" setter="set_ambient_color_energy" getter="get_ambient_color_energy" default="1.0"> + The custom ambient color energy to use within the [ReflectionProbe]'s [member extents]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. </member> <member name="ambient_mode" type="int" setter="set_ambient_mode" getter="get_ambient_mode" enum="ReflectionProbe.AmbientMode" default="1"> + The ambient color to use within the [ReflectionProbe]'s [member extents]. The ambient color will smoothly blend with other [ReflectionProbe]s and the rest of the scene (outside the [ReflectionProbe]'s [member extents]). </member> <member name="box_projection" type="bool" setter="set_enable_box_projection" getter="is_box_projection_enabled" default="false"> If [code]true[/code], enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. + [b]Note:[/b] To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the [ReflectionProbe] node. </member> <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="1048575"> - Sets the cull mask which determines what objects are drawn by this probe. Every [VisualInstance3D] with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost. + Sets the cull mask which determines what objects are drawn by this probe. Every [VisualInstance3D] with a layer included in this cull mask will be rendered by the probe. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection. </member> <member name="enable_shadows" type="bool" setter="set_enable_shadows" getter="are_shadows_enabled" default="false"> If [code]true[/code], computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [constant UPDATE_ALWAYS] [member update_mode]. </member> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(10, 10, 10)"> The size of the reflection probe. The larger the extents, the more space covered by the probe, which will lower the perceived resolution. It is best to keep the extents only as large as you need them. + [b]Note:[/b] To better fit areas that are not aligned to the grid, you can rotate the [ReflectionProbe] node. </member> <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0"> Defines the reflection intensity. Intensity modulates the strength of the reflection. @@ -35,30 +41,35 @@ <member name="interior" type="bool" setter="set_as_interior" getter="is_set_as_interior" default="false"> If [code]true[/code], reflections will ignore sky contribution. </member> - <member name="lod_threshold" type="float" setter="set_lod_threshold" getter="get_lod_threshold" default="1.0"> - </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="0.0"> - Sets the max distance away from the probe an object can be before it is culled. + The maximum distance away from the [ReflectionProbe] an object can be before it is culled. Decrease this to improve performance, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. + </member> + <member name="mesh_lod_threshold" type="float" setter="set_mesh_lod_threshold" getter="get_mesh_lod_threshold" default="1.0"> + The automatic LOD bias to use for meshes rendered within the [ReflectionProbe] (this is analog to [member Viewport.mesh_lod_threshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to [code]0.0[/code], automatic LOD is disabled. Increase [member mesh_lod_threshold] to improve performance at the cost of geometry detail, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. + [b]Note:[/b] [member mesh_lod_threshold] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD). </member> <member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" default="Vector3(0, 0, 0)"> - Sets the origin offset to be used when this reflection probe is in box project mode. + Sets the origin offset to be used when this [ReflectionProbe] is in [member box_projection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the amount of objects that "get in the way" of the reflection. </member> <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="ReflectionProbe.UpdateMode" default="0"> - Sets how frequently the probe is updated. Can be [constant UPDATE_ONCE] or [constant UPDATE_ALWAYS]. + Sets how frequently the [ReflectionProbe] is updated. Can be [constant UPDATE_ONCE] or [constant UPDATE_ALWAYS]. </member> </members> <constants> <constant name="UPDATE_ONCE" value="0" enum="UpdateMode"> - Update the probe once on the next frame. The corresponding radiance map will be generated over the following six frames. This is slower to update than [constant UPDATE_ALWAYS] but can result in higher quality reflections. + Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than [constant UPDATE_ALWAYS], but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a [ReflectionProbe] update by moving the [ReflectionProbe] slightly in any direction. </constant> <constant name="UPDATE_ALWAYS" value="1" enum="UpdateMode"> - Update the probe every frame. This is needed when you want to capture dynamic objects. However, it results in an increased render time. Use [constant UPDATE_ONCE] whenever possible. + Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [constant UPDATE_ALWAYS] at most per scene. For all other use cases, use [constant UPDATE_ONCE]. </constant> <constant name="AMBIENT_DISABLED" value="0" enum="AmbientMode"> + Do not apply any ambient lighting inside the [ReflectionProbe]'s [member extents]. </constant> <constant name="AMBIENT_ENVIRONMENT" value="1" enum="AmbientMode"> + Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s [member extents]. </constant> <constant name="AMBIENT_COLOR" value="2" enum="AmbientMode"> + Apply custom ambient lighting inside the [ReflectionProbe]'s [member extents]. See [member ambient_color] and [member ambient_color_energy]. </constant> </constants> </class> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 442dcc7d18..31c372ec80 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -560,7 +560,8 @@ <argument index="1" name="with_texture" type="RID" /> <argument index="2" name="layer" type="int" /> <argument index="3" name="mipmap" type="int" /> - <argument index="4" name="slice_type" type="int" enum="RenderingDevice.TextureSliceType" default="0" /> + <argument index="4" name="mipmaps" type="int" default="1" /> + <argument index="5" name="slice_type" type="int" enum="RenderingDevice.TextureSliceType" default="0" /> <description> </description> </method> @@ -654,6 +655,24 @@ </constant> <constant name="BARRIER_MASK_NO_BARRIER" value="8"> </constant> + <constant name="DEVICE_TYPE_OTHER" value="0" enum="DeviceType"> + Rendering device type does not match any of the other enum values or is unknown. + </constant> + <constant name="DEVICE_TYPE_INTEGRATED_GPU" value="1" enum="DeviceType"> + Rendering device is an integrated GPU, which is typically [i](but not always)[/i] slower than dedicated GPUs ([constant DEVICE_TYPE_DISCRETE_GPU]). On Android and iOS, the rendering device type is always considered to be [constant DEVICE_TYPE_INTEGRATED_GPU]. + </constant> + <constant name="DEVICE_TYPE_DISCRETE_GPU" value="2" enum="DeviceType"> + Rendering device is a dedicated GPU, which is typically [i](but not always)[/i] faster than integrated GPUs ([constant DEVICE_TYPE_INTEGRATED_GPU]). + </constant> + <constant name="DEVICE_TYPE_VIRTUAL_GPU" value="3" enum="DeviceType"> + Rendering device is an emulated GPU in a virtual environment. This is typically much slower than the host GPU, which means the expected performance level on a dedicated GPU will be roughly equivalent to [constant DEVICE_TYPE_INTEGRATED_GPU]. Virtual machine GPU passthrough (such as VFIO) will not report the device type as [constant DEVICE_TYPE_VIRTUAL_GPU]. Instead, the host GPU's device type will be reported as if the GPU was not emulated. + </constant> + <constant name="DEVICE_TYPE_CPU" value="4" enum="DeviceType"> + Rendering device is provided by software emulation (such as Lavapipe or [url=https://github.com/google/swiftshader]SwiftShader[/url]). This is the slowest kind of rendering device available; it's typically much slower than [constant DEVICE_TYPE_INTEGRATED_GPU]. + </constant> + <constant name="DEVICE_TYPE_MAX" value="5" enum="DeviceType"> + Represents the size of the [enum DeviceType] enum. + </constant> <constant name="DRIVER_RESOURCE_VULKAN_DEVICE" value="0" enum="DriverResource"> </constant> <constant name="DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE" value="1" enum="DriverResource"> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 0700650a91..5d82126839 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1232,6 +1232,13 @@ [b]Note:[/b] When running a headless or server binary, this function returns an empty string. </description> </method> + <method name="get_video_adapter_type" qualifiers="const"> + <return type="int" enum="RenderingDevice.DeviceType" /> + <description> + Returns the type of the video adapter. Since dedicated graphics cards from a given generation will [i]usually[/i] be significantly faster than integrated graphics made in the same generation, the device type can be used as a basis for automatic graphics settings adjustment. However, this is not always true, so make sure to provide users with a way to manually override graphics settings. + [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [constant RenderingDevice.DEVICE_TYPE_OTHER]. + </description> + </method> <method name="get_video_adapter_vendor" qualifiers="const"> <return type="String" /> <description> @@ -2535,19 +2542,19 @@ Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity]. </description> </method> - <method name="reflection_probe_set_lod_threshold"> + <method name="reflection_probe_set_max_distance"> <return type="void" /> <argument index="0" name="probe" type="RID" /> - <argument index="1" name="pixels" type="float" /> + <argument index="1" name="distance" type="float" /> <description> + Sets the max distance away from the probe an object can be before it is culled. Equivalent to [member ReflectionProbe.max_distance]. </description> </method> - <method name="reflection_probe_set_max_distance"> + <method name="reflection_probe_set_mesh_lod_threshold"> <return type="void" /> <argument index="0" name="probe" type="RID" /> - <argument index="1" name="distance" type="float" /> + <argument index="1" name="pixels" type="float" /> <description> - Sets the max distance away from the probe an object can be before it is culled. Equivalent to [member ReflectionProbe.max_distance]. </description> </method> <method name="reflection_probe_set_origin_offset"> @@ -4001,28 +4008,31 @@ <constant name="VIEWPORT_DEBUG_DRAW_SSAO" value="12" enum="ViewportDebugDraw"> Draws the screen space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment]. </constant> - <constant name="VIEWPORT_DEBUG_DRAW_PSSM_SPLITS" value="13" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_SSIL" value="13" enum="ViewportDebugDraw"> + Draws the screen space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssil_enabled] set in your [WorldEnvironment]. + </constant> + <constant name="VIEWPORT_DEBUG_DRAW_PSSM_SPLITS" value="14" enum="ViewportDebugDraw"> Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order they will be colored red, green, blue, yellow. </constant> - <constant name="VIEWPORT_DEBUG_DRAW_DECAL_ATLAS" value="14" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_DECAL_ATLAS" value="15" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_SDFGI" value="15" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_SDFGI" value="16" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_SDFGI_PROBES" value="16" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_SDFGI_PROBES" value="17" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_GI_BUFFER" value="17" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_GI_BUFFER" value="18" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_DISABLE_LOD" value="18" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_DISABLE_LOD" value="19" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="19" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="20" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS" value="21" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="22" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="ViewportDebugDraw"> </constant> - <constant name="VIEWPORT_DEBUG_DRAW_OCCLUDERS" value="23" enum="ViewportDebugDraw"> + <constant name="VIEWPORT_DEBUG_DRAW_OCCLUDERS" value="24" enum="ViewportDebugDraw"> </constant> <constant name="SKY_MODE_AUTOMATIC" value="0" enum="SkyMode"> </constant> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index a74b0ed812..c8ed373271 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -22,7 +22,7 @@ <argument index="1" name="width" type="int" default="0" /> <argument index="2" name="height" type="int" default="0" /> <argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="4" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="4" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <description> Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image. If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio. @@ -97,7 +97,7 @@ Returns the total number of characters from text tags. Does not include BBCodes. </description> </method> - <method name="get_v_scroll"> + <method name="get_v_scroll_bar"> <return type="VScrollBar" /> <description> Returns the vertical scrollbar. @@ -279,7 +279,7 @@ </method> <method name="push_paragraph"> <return type="void" /> - <argument index="0" name="align" type="int" enum="RichTextLabel.Align" /> + <argument index="0" name="alignment" type="int" enum="HorizontalAlignment" /> <argument index="1" name="base_direction" type="int" enum="Control.TextDirection" default="0" /> <argument index="2" name="language" type="String" default="""" /> <argument index="3" name="st_parser" type="int" enum="Control.StructuredTextParser" default="0" /> @@ -296,7 +296,7 @@ <method name="push_table"> <return type="void" /> <argument index="0" name="columns" type="int" /> - <argument index="1" name="inline_align" type="int" enum="InlineAlign" default="0" /> + <argument index="1" name="inline_align" type="int" enum="InlineAlignment" default="0" /> <description> Adds a [code][table=columns,inline_align][/code] tag to the tag stack. </description> @@ -429,6 +429,9 @@ The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed. [b]Note:[/b] Setting this property updates [member percent_visible] based on current [method get_total_character_count]. </member> + <member name="visible_characters_behavior" type="int" setter="set_visible_characters_behavior" getter="get_visible_characters_behavior" enum="RichTextLabel.VisibleCharactersBehavior" default="0"> + Sets the clipping behavior when [member visible_characters] or [member percent_visible] is set. See [enum VisibleCharactersBehavior] for more info. + </member> </members> <signals> <signal name="meta_clicked"> @@ -451,18 +454,6 @@ </signal> </signals> <constants> - <constant name="ALIGN_LEFT" value="0" enum="Align"> - Makes text left aligned. - </constant> - <constant name="ALIGN_CENTER" value="1" enum="Align"> - Makes text centered. - </constant> - <constant name="ALIGN_RIGHT" value="2" enum="Align"> - Makes text right aligned. - </constant> - <constant name="ALIGN_FILL" value="3" enum="Align"> - Makes text fill width. - </constant> <constant name="LIST_NUMBERS" value="0" enum="ListType"> Each list item has a number marker. </constant> @@ -527,6 +518,21 @@ </constant> <constant name="ITEM_CUSTOMFX" value="25" enum="ItemType"> </constant> + <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior"> + Trims text before the shaping. e.g, increasing [member visible_characters] value is visually identical to typing the text. + </constant> + <constant name="VC_CHARS_AFTER_SHAPING" value="1" enum="VisibleCharactersBehavior"> + Displays glyphs that are mapped to the first [member visible_characters] characters from the beginning of the text. + </constant> + <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior"> + Displays [member percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. + </constant> + <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> + Displays [member percent_visible] glyphs, starting from the left. + </constant> + <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> + Displays [member percent_visible] glyphs, starting from the right. + </constant> </constants> <theme_items> <theme_item name="default_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> @@ -605,7 +611,7 @@ The default text font size. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - The background The background used when the [RichTextLabel] is focused. + The background used when the [RichTextLabel] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> The normal background for the [RichTextLabel]. diff --git a/doc/classes/RigidDynamicBody2D.xml b/doc/classes/RigidDynamicBody2D.xml index b8680b99b3..b3644711a0 100644 --- a/doc/classes/RigidDynamicBody2D.xml +++ b/doc/classes/RigidDynamicBody2D.xml @@ -22,26 +22,36 @@ Allows you to read and safely modify the simulation state for the object. Use this instead of [method Node._physics_process] if you need to directly change the body's [code]position[/code] or other physics properties. By default, it works in addition to the usual physics behavior, but [member custom_integrator] allows you to disable the default behavior and write custom force integration for a body. </description> </method> - <method name="add_central_force"> + <method name="add_constant_central_force"> <return type="void" /> <argument index="0" name="force" type="Vector2" /> <description> - Adds a constant directional force without affecting rotation. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]constant_force = Vector2(0, 0)[/code]. + This is equivalent to using [method add_constant_force] at the body's center of mass. </description> </method> - <method name="add_force"> + <method name="add_constant_force"> <return type="void" /> <argument index="0" name="force" type="Vector2" /> <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> - Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]constant_force = Vector2(0, 0)[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> - <method name="add_torque"> + <method name="add_constant_torque"> <return type="void" /> <argument index="0" name="torque" type="float" /> <description> - Adds a constant rotational force. + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]constant_torque = 0[/code]. + </description> + </method> + <method name="apply_central_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector2" /> + <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method apply_force] at the body's center of mass. </description> </method> <method name="apply_central_impulse"> @@ -49,6 +59,17 @@ <argument index="0" name="impulse" type="Vector2" default="Vector2(0, 0)" /> <description> Applies a directional impulse without affecting rotation. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + This is equivalent to using [method apply_impulse] at the body's center of mass. + </description> + </method> + <method name="apply_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector2" /> + <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="apply_impulse"> @@ -56,14 +77,24 @@ <argument index="0" name="impulse" type="Vector2" /> <argument index="1" name="position" type="Vector2" default="Vector2(0, 0)" /> <description> - Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The position uses the rotation of the global coordinate system, but is centered at the object's origin. + Applies a positioned impulse to the body. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="apply_torque"> + <return type="void" /> + <argument index="0" name="torque" type="float" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="apply_torque_impulse"> <return type="void" /> <argument index="0" name="torque" type="float" /> <description> - Applies a rotational impulse to the body. + Applies a rotational impulse to the body without affecting the position. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). </description> </method> <method name="get_colliding_bodies" qualifiers="const"> @@ -90,13 +121,7 @@ Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. </member> <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity" default="0.0"> - The body's rotational velocity. - </member> - <member name="applied_force" type="Vector2" setter="set_applied_force" getter="get_applied_force" default="Vector2(0, 0)"> - The body's total applied force. - </member> - <member name="applied_torque" type="float" setter="set_applied_torque" getter="get_applied_torque" default="0.0"> - The body's total applied torque. + The body's rotational velocity in [i]radians[/i] per second. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. @@ -108,6 +133,14 @@ <member name="center_of_mass_mode" type="int" setter="set_center_of_mass_mode" getter="get_center_of_mass_mode" enum="RigidDynamicBody2D.CenterOfMassMode" default="0"> Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. </member> + <member name="constant_force" type="Vector2" setter="set_constant_force" getter="get_constant_force" default="Vector2(0, 0)"> + The body's total constant positional forces applied during each physics update. + See [method add_constant_force] and [method add_constant_central_force]. + </member> + <member name="constant_torque" type="float" setter="set_constant_torque" getter="get_constant_torque" default="0.0"> + The body's total constant rotational forces applied during each physics update. + See [method add_constant_torque]. + </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false"> If [code]true[/code], the body will emit signals when it collides with another RigidDynamicBody2D. See also [member contacts_reported]. </member> @@ -146,7 +179,7 @@ Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. </member> <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> - The body's linear velocity. + The body's linear velocity in pixels per second. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. </member> <member name="lock_rotation" type="bool" setter="set_lock_rotation_enabled" getter="is_lock_rotation_enabled" default="false"> If [code]true[/code], the body cannot rotate. Gravity and forces only apply linear movement. @@ -159,7 +192,7 @@ If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> - If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods. + If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method apply_force] methods. </member> </members> <signals> diff --git a/doc/classes/RigidDynamicBody3D.xml b/doc/classes/RigidDynamicBody3D.xml index c75055e0df..16fced737f 100644 --- a/doc/classes/RigidDynamicBody3D.xml +++ b/doc/classes/RigidDynamicBody3D.xml @@ -22,28 +22,36 @@ Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [member custom_integrator] property allows you to disable the default behavior and do fully custom force integration for a body. </description> </method> - <method name="add_central_force"> + <method name="add_constant_central_force"> <return type="void" /> <argument index="0" name="force" type="Vector3" /> <description> - Adds a constant directional force (i.e. acceleration) without affecting rotation. - This is equivalent to [code]add_force(force, Vector3(0,0,0))[/code]. + Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with [code]constant_force = Vector3(0, 0, 0)[/code]. + This is equivalent to using [method add_constant_force] at the body's center of mass. </description> </method> - <method name="add_force"> + <method name="add_constant_force"> <return type="void" /> <argument index="0" name="force" type="Vector3" /> <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Adds a constant directional force (i.e. acceleration). - The position uses the rotation of the global coordinate system, but is centered at the object's origin. + Adds a constant positioned force to the body that keeps being applied over time until cleared with [code]constant_force = Vector3(0, 0, 0)[/code]. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> - <method name="add_torque"> + <method name="add_constant_torque"> <return type="void" /> <argument index="0" name="torque" type="Vector3" /> <description> - Adds a constant rotational force (i.e. a motor) without affecting position. + Adds a constant rotational force without affecting position that keeps being applied over time until cleared with [code]constant_torque = Vector3(0, 0, 0)[/code]. + </description> + </method> + <method name="apply_central_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <description> + Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + This is equivalent to using [method apply_force] at the body's center of mass. </description> </method> <method name="apply_central_impulse"> @@ -51,7 +59,17 @@ <argument index="0" name="impulse" type="Vector3" /> <description> Applies a directional impulse without affecting rotation. - This is equivalent to [code]apply_impulse(Vector3(0,0,0), impulse)[/code]. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + This is equivalent to using [method apply_impulse] at the body's center of mass. + </description> + </method> + <method name="apply_force"> + <return type="void" /> + <argument index="0" name="force" type="Vector3" /> + <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> + <description> + Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + [code]position[/code] is the offset from the body origin in global coordinates. </description> </method> <method name="apply_impulse"> @@ -59,14 +77,24 @@ <argument index="0" name="impulse" type="Vector3" /> <argument index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" /> <description> - Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. + Applies a positioned impulse to the body. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + [code]position[/code] is the offset from the body origin in global coordinates. + </description> + </method> + <method name="apply_torque"> + <return type="void" /> + <argument index="0" name="torque" type="Vector3" /> + <description> + Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. </description> </method> <method name="apply_torque_impulse"> <return type="void" /> <argument index="0" name="impulse" type="Vector3" /> <description> - Applies a torque impulse which will be affected by the body mass and shape. This will rotate the body around the [code]impulse[/code] vector passed. + Applies a rotational impulse to the body without affecting the position. + An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). </description> </method> <method name="get_colliding_bodies" qualifiers="const"> @@ -99,7 +127,7 @@ Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. </member> <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)"> - RigidDynamicBody3D's rotational velocity. + The RigidDynamicBody3D's rotational velocity in [i]radians[/i] per second. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true"> If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. @@ -111,6 +139,14 @@ <member name="center_of_mass_mode" type="int" setter="set_center_of_mass_mode" getter="get_center_of_mass_mode" enum="RigidDynamicBody3D.CenterOfMassMode" default="0"> Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. </member> + <member name="constant_force" type="Vector3" setter="set_constant_force" getter="get_constant_force" default="Vector3(0, 0, 0)"> + The body's total constant positional forces applied during each physics update. + See [method add_constant_force] and [method add_constant_central_force]. + </member> + <member name="constant_torque" type="Vector3" setter="set_constant_torque" getter="get_constant_torque" default="Vector3(0, 0, 0)"> + The body's total constant rotational forces applied during each physics update. + See [method add_constant_torque]. + </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false"> If [code]true[/code], the RigidDynamicBody3D will emit signals when it collides with another RigidDynamicBody3D. See also [member contacts_reported]. </member> @@ -149,7 +185,7 @@ Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. </member> <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> - The body's linear velocity. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. + The body's linear velocity in units per second. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. </member> <member name="lock_rotation" type="bool" setter="set_lock_rotation_enabled" getter="is_lock_rotation_enabled" default="false"> If [code]true[/code], the body cannot rotate. Gravity and forces only apply linear movement. @@ -162,7 +198,7 @@ If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> - If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods. + If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method apply_force] methods. </member> </members> <signals> diff --git a/doc/classes/SceneState.xml b/doc/classes/SceneState.xml index 9a22b24825..c3d726f705 100644 --- a/doc/classes/SceneState.xml +++ b/doc/classes/SceneState.xml @@ -59,6 +59,13 @@ Returns the path to the node that owns the method connected to the signal at [code]idx[/code], relative to the root node. </description> </method> + <method name="get_connection_unbinds" qualifiers="const"> + <return type="int" /> + <argument index="0" name="idx" type="int" /> + <description> + Returns the number of unbound parameters for the signal at [code]idx[/code]. + </description> + </method> <method name="get_node_count" qualifiers="const"> <return type="int" /> <description> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index ab88bdaa73..4174e1afeb 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -5,6 +5,7 @@ </brief_description> <description> A class stored as a resource. A script extends the functionality of all objects that instance it. + This is the base class for all scripts and should not be used directly. Trying to create a new script with this class will result in an error. The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <tutorials> diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index f0c739bfa3..948c052a20 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -16,20 +16,26 @@ <argument index="0" name="control" type="Control" /> <description> Ensures the given [code]control[/code] is visible (must be a direct or indirect child of the ScrollContainer). Used by [member follow_focus]. + [b]Note:[/b] This will not work on a node that was just added during the same frame. If you want to scroll to a newly added child, you must wait until the next frame using [signal SceneTree.process_frame]: + [codeblock] + add_child(child_node) + await get_tree().process_frame + ensure_control_visible(child_node) + [/codeblock] </description> </method> - <method name="get_h_scrollbar"> + <method name="get_h_scroll_bar"> <return type="HScrollBar" /> <description> Returns the horizontal scrollbar [HScrollBar] of this [ScrollContainer]. - [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the horizontal scrollbar, use [member scroll_horizontal_enabled]. If you want to only hide it instead, use [member scroll_horizontal_visible]. + [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to disable or hide a scrollbar, you can use [member horizontal_scroll_mode]. </description> </method> - <method name="get_v_scrollbar"> + <method name="get_v_scroll_bar"> <return type="VScrollBar" /> <description> Returns the vertical scrollbar [VScrollBar] of this [ScrollContainer]. - [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the vertical scrollbar, use [member scroll_vertical_enabled]. If you want to only hide it instead, use [member scroll_vertical_visible]. + [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to disable or hide a scrollbar, you can use [member vertical_scroll_mode]. </description> </method> </methods> @@ -37,26 +43,20 @@ <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" default="false"> If [code]true[/code], the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. </member> + <member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" enum="ScrollContainer.ScrollMode" default="1"> + Controls whether horizontal scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. + </member> <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" /> <member name="scroll_deadzone" type="int" setter="set_deadzone" getter="get_deadzone" default="0"> </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> The current horizontal scroll value. </member> - <member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" default="true"> - If [code]true[/code], enables horizontal scrolling. - </member> - <member name="scroll_horizontal_visible" type="bool" setter="set_h_scroll_visible" getter="is_h_scroll_visible" default="true"> - If [code]false[/code], hides the horizontal scrollbar. - </member> <member name="scroll_vertical" type="int" setter="set_v_scroll" getter="get_v_scroll" default="0"> The current vertical scroll value. </member> - <member name="scroll_vertical_enabled" type="bool" setter="set_enable_v_scroll" getter="is_v_scroll_enabled" default="true"> - If [code]true[/code], enables vertical scrolling. - </member> - <member name="scroll_vertical_visible" type="bool" setter="set_v_scroll_visible" getter="is_v_scroll_visible" default="true"> - If [code]false[/code], hides the vertical scrollbar. + <member name="vertical_scroll_mode" type="int" setter="set_vertical_scroll_mode" getter="get_vertical_scroll_mode" enum="ScrollContainer.ScrollMode" default="1"> + Controls whether vertical scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. </member> </members> <signals> @@ -71,6 +71,20 @@ </description> </signal> </signals> + <constants> + <constant name="SCROLL_MODE_DISABLED" value="0" enum="ScrollMode"> + Scrolling disabled, scrollbar will be invisible. + </constant> + <constant name="SCROLL_MODE_AUTO" value="1" enum="ScrollMode"> + Scrolling enabled, scrollbar will be visible only if necessary, i.e. container's content is bigger than the container. + </constant> + <constant name="SCROLL_MODE_SHOW_ALWAYS" value="2" enum="ScrollMode"> + Scrolling enabled, scrollbar will be always visible. + </constant> + <constant name="SCROLL_MODE_SHOW_NEVER" value="3" enum="ScrollMode"> + Scrolling enabled, scrollbar will be hidden. + </constant> + </constants> <theme_items> <theme_item name="bg" data_type="style" type="StyleBox"> The background [StyleBox] of the [ScrollContainer]. diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index 9746519173..4c12ee36f6 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -65,7 +65,8 @@ </methods> <members> <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> - The shape's custom solver bias. + The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. + When set to [code]0[/code], the default value from [member ProjectSettings.physics/2d/solver/default_contact_bias] is used. </member> </members> </class> diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml index 67af52768f..010b993327 100644 --- a/doc/classes/Shape3D.xml +++ b/doc/classes/Shape3D.xml @@ -18,6 +18,10 @@ </method> </methods> <members> + <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> + The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. + When set to [code]0[/code], the default value from [member ProjectSettings.physics/3d/solver/default_contact_bias] is used. + </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04"> The collision margin for the shape. Used in Bullet Physics only. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index e804e7bf24..aa56f852a7 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -297,7 +297,7 @@ <argument index="3" name="persistent" type="bool" default="false" /> <description> Sets the global pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code]. - [code]amount[/code] is the interpolation strengh that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. + [code]amount[/code] is the interpolation strength that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. [b]Note:[/b] The pose transform needs to be a global pose! Use [method world_transform_to_global_pose] to convert a world transform, like one you can get from a [Node3D], to a global pose. </description> </method> @@ -309,7 +309,7 @@ <argument index="3" name="persistent" type="bool" default="false" /> <description> Sets the local pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code]. - [code]amount[/code] is the interpolation strengh that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. + [code]amount[/code] is the interpolation strength that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. [b]Note:[/b] The pose transform needs to be a local pose! Use [method global_pose_to_local_pose] to convert a global pose to a local pose. </description> </method> diff --git a/doc/classes/SkeletonModification3D.xml b/doc/classes/SkeletonModification3D.xml index c544473163..90ccd8f42e 100644 --- a/doc/classes/SkeletonModification3D.xml +++ b/doc/classes/SkeletonModification3D.xml @@ -60,7 +60,7 @@ When true, the modification's [method _execute] function will be called by the [SkeletonModificationStack3D]. </member> <member name="execution_mode" type="int" setter="set_execution_mode" getter="get_execution_mode" default="0"> - The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only availible in certain execution modes. + The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes. </member> </members> </class> diff --git a/doc/classes/SkeletonModification3DCCDIK.xml b/doc/classes/SkeletonModification3DCCDIK.xml index 55777ab0f4..606dce4961 100644 --- a/doc/classes/SkeletonModification3DCCDIK.xml +++ b/doc/classes/SkeletonModification3DCCDIK.xml @@ -4,7 +4,7 @@ A modification that uses CCDIK to manipulate a series of bones to reach a target. </brief_description> <description> - This [SkeletonModification3D] uses an algorithm called Cyclic Coordinate Descent Inverse Kinematics, or CCDIK, to maniuplate a chain of bones in a Skeleton so it reaches a defined target. + This [SkeletonModification3D] uses an algorithm called Cyclic Coordinate Descent Inverse Kinematics, or CCDIK, to manipulate a chain of bones in a Skeleton so it reaches a defined target. CCDIK works by rotating a set of bones, typically called a "bone chain", on a single axis. Each bone is rotated to face the target from the tip (by default), which over a chain of bones allow it to rotate properly to reach the target. Because the bones only rotate on a single axis, CCDIK [i]can[/i] look more robotic than other IK solvers. [b]Note:[/b] The CCDIK modifier has [code]ccdik_joints[/code], which are the data objects that hold the data for each joint in the CCDIK chain. This is different from a bone! CCDIK joints hold the data needed for each bone in the bone chain used by CCDIK. CCDIK also fully supports angle constraints, allowing for more control over how a solution is met. diff --git a/doc/classes/SkeletonModification3DFABRIK.xml b/doc/classes/SkeletonModification3DFABRIK.xml index 1c69ad7b3f..7c1a021c44 100644 --- a/doc/classes/SkeletonModification3DFABRIK.xml +++ b/doc/classes/SkeletonModification3DFABRIK.xml @@ -24,7 +24,7 @@ <return type="bool" /> <argument index="0" name="joint_idx" type="int" /> <description> - Returns a boolean that indiciates whether this modification will attempt to autocalculate the length of the bone assigned to the FABRIK joint at [code]joint_idx[/code]. + Returns a boolean that indicates whether this modification will attempt to autocalculate the length of the bone assigned to the FABRIK joint at [code]joint_idx[/code]. </description> </method> <method name="get_fabrik_joint_bone_index" qualifiers="const"> @@ -66,7 +66,7 @@ <return type="bool" /> <argument index="0" name="joint_idx" type="int" /> <description> - Returns a boolean indiciating whether the FABRIK joint uses the target's [Basis] for its rotation. + Returns a boolean indicating whether the FABRIK joint uses the target's [Basis] for its rotation. [b]Note:[/b] This option is only available for the final bone in the FABRIK chain, with this setting being ignored for all other bones. </description> </method> diff --git a/doc/classes/SkeletonModification3DJiggle.xml b/doc/classes/SkeletonModification3DJiggle.xml index 3c724229bd..605b28363b 100644 --- a/doc/classes/SkeletonModification3DJiggle.xml +++ b/doc/classes/SkeletonModification3DJiggle.xml @@ -56,7 +56,7 @@ <return type="bool" /> <argument index="0" name="joint_idx" type="int" /> <description> - Returns a boolean that indiciates whether the joint at [code]joint_idx[/code] is overriding the default jiggle joint data defined in the modification. + Returns a boolean that indicates whether the joint at [code]joint_idx[/code] is overriding the default jiggle joint data defined in the modification. </description> </method> <method name="get_jiggle_joint_roll" qualifiers="const"> @@ -77,7 +77,7 @@ <return type="bool" /> <argument index="0" name="joint_idx" type="int" /> <description> - Returns a boolean that indiciates whether the joint at [code]joint_idx[/code] is using gravity or not. + Returns a boolean that indicates whether the joint at [code]joint_idx[/code] is using gravity or not. </description> </method> <method name="get_use_colliders" qualifiers="const"> diff --git a/doc/classes/SkeletonModification3DTwoBoneIK.xml b/doc/classes/SkeletonModification3DTwoBoneIK.xml index 0e83cd0b28..2edcda6bfd 100644 --- a/doc/classes/SkeletonModification3DTwoBoneIK.xml +++ b/doc/classes/SkeletonModification3DTwoBoneIK.xml @@ -4,7 +4,7 @@ A modification that moves two bones to reach the target. </brief_description> <description> - This [SkeletonModification3D] uses an algorithm typically called TwoBoneIK. This algorithm works by leveraging the law of cosigns and the lengths of the bones to figure out what rotation the bones currently have, and what rotation they need to make a complete triangle, where the first bone, the second bone, and the target form the three vertices of the triangle. Because the algorithm works by making a triangle, it can only opperate on two bones. + This [SkeletonModification3D] uses an algorithm typically called TwoBoneIK. This algorithm works by leveraging the law of cosigns and the lengths of the bones to figure out what rotation the bones currently have, and what rotation they need to make a complete triangle, where the first bone, the second bone, and the target form the three vertices of the triangle. Because the algorithm works by making a triangle, it can only operate on two bones. TwoBoneIK is great for arms, legs, and really any joints that can be represented by just two bones that bend to reach a target. This solver is more lightweight than [SkeletonModification3DFABRIK], but gives similar, natural looking results. A [Node3D]-based node can be used to define the pole, or bend direction, allowing control over which direction the joint takes when bending to reach the target when the target is within reach. </description> diff --git a/doc/classes/SkeletonModificationStack3D.xml b/doc/classes/SkeletonModificationStack3D.xml index 4035e39410..032fe6e032 100644 --- a/doc/classes/SkeletonModificationStack3D.xml +++ b/doc/classes/SkeletonModificationStack3D.xml @@ -43,7 +43,7 @@ <method name="get_is_setup" qualifiers="const"> <return type="bool" /> <description> - Returns a boolean that indiciates whether the modification stack is setup and can execute. + Returns a boolean that indicates whether the modification stack is setup and can execute. </description> </method> <method name="get_modification" qualifiers="const"> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 615f5e3586..392d4d6a65 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -12,14 +12,14 @@ add_child(spin_box) var line_edit = spin_box.get_line_edit() line_edit.context_menu_enabled = false - spin_box.align = LineEdit.ALIGN_RIGHT + spin_box.horizontal_alignment = LineEdit.HORIZONTAL_ALIGNMENT_RIGHT [/gdscript] [csharp] var spinBox = new SpinBox(); AddChild(spinBox); var lineEdit = spinBox.GetLineEdit(); lineEdit.ContextMenuEnabled = false; - spinBox.Align = LineEdit.AlignEnum.Right; + spinBox.AlignHorizontal = LineEdit.HorizontalAlignEnum.Right; [/csharp] [/codeblocks] The above code will create a [SpinBox], disable context menu on it and set the text alignment to right. @@ -44,8 +44,7 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0"> - Sets the text alignment of the [SpinBox]. + <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> </member> <member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true"> If [code]true[/code], the [SpinBox] will be editable. Otherwise, it will be read only. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index ce902c1216..d86c577e5e 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -124,7 +124,7 @@ <method name="dedent" qualifiers="const"> <return type="String" /> <description> - Returns a copy of the string with indentation (leading tabs and spaces) removed. + Returns a copy of the string with indentation (leading tabs and spaces) removed. See also [method indent] to add indentation. </description> </method> <method name="ends_with" qualifiers="const"> @@ -243,6 +243,15 @@ <description> </description> </method> + <method name="indent" qualifiers="const"> + <return type="String" /> + <argument index="0" name="prefix" type="String" /> + <description> + Returns a copy of the string with lines indented with [code]prefix[/code]. + For example, the string can be indented with two tabs using [code]"\t\t"[/code], or four spaces using [code]" "[/code]. The prefix can be any string so it can also be used to comment out strings with e.g. [code]"# "[/code]. See also [method dedent] to remove indentation. + [b]Note:[/b] Empty lines are kept empty. + </description> + </method> <method name="insert" qualifiers="const"> <return type="String" /> <argument index="0" name="position" type="int" /> @@ -331,7 +340,7 @@ <return type="String" /> <argument index="0" name="parts" type="PackedStringArray" /> <description> - Return a [String] which is the concatenation of the [code]parts[/code]. The separator between elements is the string providing this method. + Returns a [String] which is the concatenation of the [code]parts[/code]. The separator between elements is the string providing this method. Example: [codeblocks] [gdscript] diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index a9b09fb026..f97b3e08d1 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -209,8 +209,7 @@ <member name="scrolling_enabled" type="bool" setter="set_scrolling_enabled" getter="get_scrolling_enabled" default="true"> if [code]true[/code], the mouse's scroll wheel can be used to navigate the scroll view. </member> - <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabBar.TabAlign" default="1"> - The alignment of all tabs. See [enum TabAlign] for details. + <member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabBar.AlignmentMode" default="1"> </member> <member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" enum="TabBar.CloseButtonDisplayPolicy" default="0"> Sets when the close button will appear on the tabs. See [enum CloseButtonDisplayPolicy] for details. @@ -264,17 +263,13 @@ </signal> </signals> <constants> - <constant name="ALIGN_LEFT" value="0" enum="TabAlign"> - Align the tabs to the left. + <constant name="ALIGNMENT_LEFT" value="0" enum="AlignmentMode"> </constant> - <constant name="ALIGN_CENTER" value="1" enum="TabAlign"> - Align the tabs to the center. + <constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode"> </constant> - <constant name="ALIGN_RIGHT" value="2" enum="TabAlign"> - Align the tabs to the right. + <constant name="ALIGNMENT_RIGHT" value="2" enum="AlignmentMode"> </constant> - <constant name="ALIGN_MAX" value="3" enum="TabAlign"> - Represents the size of the [enum TabAlign] enum. + <constant name="ALIGNMENT_MAX" value="3" enum="AlignmentMode"> </constant> <constant name="CLOSE_BUTTON_SHOW_NEVER" value="0" enum="CloseButtonDisplayPolicy"> Never show the close buttons. diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 2ac6549250..d6e1e13505 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -141,8 +141,7 @@ <member name="drag_to_rearrange_enabled" type="bool" setter="set_drag_to_rearrange_enabled" getter="get_drag_to_rearrange_enabled" default="false"> If [code]true[/code], tabs can be rearranged with mouse drag. </member> - <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign" default="1"> - The alignment of all tabs in the tab container. See the [enum TabAlign] constants for details. + <member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabContainer.AlignmentMode" default="1"> </member> <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" default="true"> If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden. @@ -171,14 +170,11 @@ </signal> </signals> <constants> - <constant name="ALIGN_LEFT" value="0" enum="TabAlign"> - Align the tabs to the left. + <constant name="ALIGNMENT_LEFT" value="0" enum="AlignmentMode"> </constant> - <constant name="ALIGN_CENTER" value="1" enum="TabAlign"> - Align the tabs to the center. + <constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode"> </constant> - <constant name="ALIGN_RIGHT" value="2" enum="TabAlign"> - Align the tabs to the right. + <constant name="ALIGNMENT_RIGHT" value="2" enum="AlignmentMode"> </constant> </constants> <theme_items> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index ffc91decca..26ad20e85b 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -201,7 +201,7 @@ <method name="get_last_full_visible_line" qualifiers="const"> <return type="int" /> <description> - Return the last visible line. Use [method get_last_full_visible_line_wrap_index] for the wrap index. + Returns the last visible line. Use [method get_last_full_visible_line_wrap_index] for the wrap index. </description> </method> <method name="get_last_full_visible_line_wrap_index" qualifiers="const"> @@ -1271,7 +1271,7 @@ Sets a custom [Texture2D] for tab text characters. </theme_item> <theme_item name="focus" data_type="style" type="StyleBox"> - Sets the [StyleBox] when in focus. + Sets the [StyleBox] when in focus. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> Sets the [StyleBox] of this [TextEdit]. diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index 598d0fb859..1eaccf4604 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -13,7 +13,7 @@ <return type="bool" /> <argument index="0" name="key" type="Variant" /> <argument index="1" name="size" type="Vector2" /> - <argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <argument index="3" name="length" type="int" default="1" /> <description> Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters. @@ -122,7 +122,7 @@ <return type="bool" /> <argument index="0" name="key" type="Variant" /> <argument index="1" name="size" type="Vector2" /> - <argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <description> Sets new size and alignment of embedded object. </description> @@ -144,8 +144,7 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0"> - Text horizontal alignment. + <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> </member> <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> Text writing direction. diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index a7122b827e..ff193a0e4b 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -13,7 +13,7 @@ <return type="bool" /> <argument index="0" name="key" type="Variant" /> <argument index="1" name="size" type="Vector2" /> - <argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <argument index="3" name="length" type="int" default="1" /> <description> Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters. @@ -113,7 +113,7 @@ <method name="get_dropcap_rid" qualifiers="const"> <return type="RID" /> <description> - Return drop cap text buffer RID. + Returns drop cap text buffer RID. </description> </method> <method name="get_dropcap_size" qualifiers="const"> @@ -240,7 +240,7 @@ <return type="bool" /> <argument index="0" name="key" type="Variant" /> <argument index="1" name="size" type="Vector2" /> - <argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <description> Sets new size and alignment of embedded object. </description> @@ -275,7 +275,7 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0"> + <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="HorizontalAlignment" default="0"> Paragraph horizontal alignment. </member> <member name="custom_punctuation" type="String" setter="set_custom_punctuation" getter="get_custom_punctuation" default=""""> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 512078c56c..443716435a 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -244,7 +244,7 @@ <return type="int" /> <argument index="0" name="font_rid" type="RID" /> <description> - Return the width of the range around the shape between the minimum and maximum representable signed distance. + Returns the width of the range around the shape between the minimum and maximum representable signed distance. </description> </method> <method name="font_get_msdf_size" qualifiers="const"> @@ -295,7 +295,7 @@ <return type="Array" /> <argument index="0" name="font_rid" type="RID" /> <description> - Return list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. + Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> <method name="font_get_spacing" qualifiers="const"> @@ -382,7 +382,7 @@ <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="char" type="int" /> <description> - Return [code]true[/code] if a Unicode [code]char[/code] is available in the font. + Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> <method name="font_is_antialiased" qualifiers="const"> @@ -396,7 +396,7 @@ <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <description> - Returns [code]true[/code] if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only. + Returns [code]true[/code] if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. </description> </method> <method name="font_is_language_supported" qualifiers="const"> @@ -541,7 +541,7 @@ <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="force_autohinter" type="bool" /> <description> - If set to [code]true[/code] auto-hinting is preffered over font built-in hinting. + If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. </description> </method> <method name="font_set_global_oversampling"> @@ -549,7 +549,7 @@ <argument index="0" name="oversampling" type="float" /> <description> Sets oversampling factor, shared by all font in the TextServer. - [b]Note:[/b] This value can be automaticaly changed by display server. + [b]Note:[/b] This value can be automatically changed by display server. </description> </method> <method name="font_set_glyph_advance"> @@ -886,7 +886,7 @@ <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> <argument index="2" name="size" type="Vector2" /> - <argument index="3" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="3" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <argument index="4" name="length" type="int" default="1" /> <description> Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters. @@ -1213,7 +1213,7 @@ <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> <argument index="2" name="size" type="Vector2" /> - <argument index="3" name="inline_align" type="int" enum="InlineAlign" default="5" /> + <argument index="3" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <description> Sets new size and alignment of embedded object. </description> @@ -1384,7 +1384,7 @@ <constant name="OVERRUN_JUSTIFICATION_AWARE" value="16" enum="TextOverrunFlag"> </constant> <constant name="GRAPHEME_IS_VALID" value="1" enum="GraphemeFlag"> - Grapheme is supprted by the font, and can be drawn. + Grapheme is supported by the font, and can be drawn. </constant> <constant name="GRAPHEME_IS_RTL" value="2" enum="GraphemeFlag"> Grapheme is part of right-to-left or bottom-to-top run. diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 32f8107e0a..fb4ac630ba 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -396,7 +396,7 @@ <return type="bool" /> <argument index="0" name="font_rid" type="RID" /> <description> - Returns [code]true[/code] if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only. + Returns [code]true[/code] if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. </description> </method> <method name="_font_is_language_supported" qualifiers="virtual const"> @@ -542,7 +542,7 @@ <argument index="0" name="font_rid" type="RID" /> <argument index="1" name="fixed_size" type="int" /> <description> - If set to [code]true[/code] auto-hinting is preffered over font built-in hinting. + If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. </description> </method> <method name="_font_set_force_autohinter" qualifiers="virtual"> @@ -557,7 +557,7 @@ <argument index="0" name="oversampling" type="float" /> <description> Sets oversampling factor, shared by all font in the TextServer. - [b]Note:[/b] This value can be automaticaly changed by display server. + [b]Note:[/b] This value can be automatically changed by display server. </description> </method> <method name="_font_set_glyph_advance" qualifiers="virtual"> @@ -893,7 +893,7 @@ <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> <argument index="2" name="size" type="Vector2" /> - <argument index="3" name="inline_align" type="int" enum="InlineAlign" /> + <argument index="3" name="inline_align" type="int" enum="InlineAlignment" /> <argument index="4" name="length" type="int" /> <description> Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters. @@ -1222,7 +1222,7 @@ <argument index="0" name="shaped" type="RID" /> <argument index="1" name="key" type="Variant" /> <argument index="2" name="size" type="Vector2" /> - <argument index="3" name="inline_align" type="int" enum="InlineAlign" /> + <argument index="3" name="inline_align" type="int" enum="InlineAlignment" /> <description> Sets new size and alignment of embedded object. </description> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index 2be27617ab..476ab2d1bf 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -31,7 +31,7 @@ Texture to display when the node is disabled. See [member BaseButton.disabled]. </member> <member name="texture_focused" type="Texture2D" setter="set_focused_texture" getter="get_focused_texture"> - Texture to display when the node has mouse or keyboard focus. + Texture to display when the node has mouse or keyboard focus. [member texture_focused] is displayed [i]over[/i] the base texture, so a partially transparent texture should be used to ensure the base texture remains visible. A texture that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a fully transparent texture of any size. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. </member> <member name="texture_hover" type="Texture2D" setter="set_hover_texture" getter="get_hover_texture"> Texture to display when the mouse hovers the node. diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 6e552e3649..e37031f3fd 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -69,7 +69,7 @@ <description> Triggers an update of the TileMap. If [code]layer[/code] is provided, only updates the given layer. [b]Note:[/b] The TileMap node updates automatically when one of its properties is modified. A manual update is only needed if runtime modifications (implemented in [method _tile_data_runtime_update]) need to be applied. - [b]Warning:[/b] Updating the TileMap is a performance demanding task. Limit occurences of those updates to the minimum and limit the amount tiles they impact (by segregating tiles updated often to a dedicated layer for example). + [b]Warning:[/b] Updating the TileMap is a performance demanding task. Limit occurrences of those updates to the minimum and limit the amount tiles they impact (by segregating tiles updated often to a dedicated layer for example). </description> </method> <method name="get_cell_alternative_tile" qualifiers="const"> @@ -103,7 +103,7 @@ <return type="Vector2i" /> <argument index="0" name="body" type="RID" /> <description> - Returns the coodinates of the tile for given physics body RID. Such RID can be retrieved from [method KinematicCollision2D.get_collider_rid], when colliding with a tile. + Returns the coordinates of the tile for given physics body RID. Such RID can be retrieved from [method KinematicCollision2D.get_collider_rid], when colliding with a tile. </description> </method> <method name="get_layer_modulate" qualifiers="const"> @@ -144,7 +144,7 @@ <argument index="0" name="coords" type="Vector2i" /> <argument index="1" name="neighbor" type="int" enum="TileSet.CellNeighbor" /> <description> - Returns the neighboring cell to the one at coordinates [code]coords[/code], indentified by the [code]neighbor[/code] direction. This method takes into account the different layouts a TileMap can take. + Returns the neighboring cell to the one at coordinates [code]coords[/code], identified by the [code]neighbor[/code] direction. This method takes into account the different layouts a TileMap can take. </description> </method> <method name="get_pattern"> @@ -195,7 +195,7 @@ <argument index="1" name="coords_in_pattern" type="Vector2i" /> <argument index="2" name="pattern" type="TileMapPattern" /> <description> - Returns for the given coodinate [code]coords_in_pattern[/code] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [code]position_in_tilemap[/code] coordinates (see [method set_pattern]). This mapping is required as in half-offset tile shapes, the mapping might not work by calculating [code]position_in_tile_map + coords_in_pattern[/code] + Returns for the given coordinate [code]coords_in_pattern[/code] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [code]position_in_tilemap[/code] coordinates (see [method set_pattern]). This mapping is required as in half-offset tile shapes, the mapping might not work by calculating [code]position_in_tile_map + coords_in_pattern[/code] </description> </method> <method name="map_to_world" qualifiers="const"> @@ -229,7 +229,7 @@ <argument index="4" name="alternative_tile" type="int" default="-1" /> <description> Sets the tile indentifiers for the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. Each tile of the [TileSet] is identified using three parts: - - The source indentifier [code]source_id[/code] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id], + - The source identifier [code]source_id[/code] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id], - The atlas coordinates identifier [code]atlas_coords[/code] identifies a tile coordinates in the atlas (if the source is a [TileSetAtlasSource]. For [TileSetScenesCollectionSource] it should be 0), - The alternative tile identifier [code]alternative_tile[/code] identifies a tile alternative the source is a [TileSetAtlasSource], and the scene for a [TileSetScenesCollectionSource]. </description> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 5d9065f823..6fc92f6a31 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -51,7 +51,7 @@ <argument index="0" name="pattern" type="TileMapPattern" /> <argument index="1" name="index" type="int" default="-1" /> <description> - Adds a [TileMapPattern] to be stored in the TileSet resouce. If provided, insert it at the given [code]index[/code]. + Adds a [TileMapPattern] to be stored in the TileSet resource. If provided, insert it at the given [code]index[/code]. </description> </method> <method name="add_physics_layer"> @@ -582,7 +582,7 @@ Diamond tile shape (for isometric look). </constant> <constant name="TILE_SHAPE_HALF_OFFSET_SQUARE" value="2" enum="TileShape"> - Rectangular tile shape with one row/colum out of two offset by half a tile. + Rectangular tile shape with one row/column out of two offset by half a tile. </constant> <constant name="TILE_SHAPE_HEXAGON" value="3" enum="TileShape"> Hexagonal tile shape. diff --git a/doc/classes/TileSetScenesCollectionSource.xml b/doc/classes/TileSetScenesCollectionSource.xml index 3451519ff6..f62ba7a337 100644 --- a/doc/classes/TileSetScenesCollectionSource.xml +++ b/doc/classes/TileSetScenesCollectionSource.xml @@ -4,8 +4,8 @@ Exposes a set of scenes as tiles for a [TileSet] resource. </brief_description> <description> - When placed on a [TileMap], tiles from [TileSetScenesCollectionSource] will automatically instanciate an assiciated scene at the cell's position in the TileMap. - Scenes are instanciated as children of the [TileMap] when it enters the tree. If you add/remove a scene tile in the [TileMap] that is already inside the tree, the [TileMap] will automatically instanciate/free the scene accordingly. + When placed on a [TileMap], tiles from [TileSetScenesCollectionSource] will automatically instantiate an associated scene at the cell's position in the TileMap. + Scenes are instantiated as children of the [TileMap] when it enters the tree. If you add/remove a scene tile in the [TileMap] that is already inside the tree, the [TileMap] will automatically instantiate/free the scene accordingly. </description> <tutorials> </tutorials> @@ -87,7 +87,7 @@ <argument index="0" name="id" type="int" /> <argument index="1" name="packed_scene" type="PackedScene" /> <description> - Assigns a [PackedScene] resource to the scene tile with id [code]id[/code]. This will fail if the scene does not extend CanvasItem, as positionning properties are needed to place the scene on the TileMap. + Assigns a [PackedScene] resource to the scene tile with id [code]id[/code]. This will fail if the scene does not extend CanvasItem, as positioning properties are needed to place the scene on the TileMap. </description> </method> </methods> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index b997d87ac0..7da98788bb 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -293,8 +293,8 @@ Returns the given column's text. </description> </method> - <method name="get_text_align" qualifiers="const"> - <return type="int" enum="TreeItem.TextAlign" /> + <method name="get_text_alignment" qualifiers="const"> + <return type="int" enum="HorizontalAlignment" /> <argument index="0" name="column" type="int" /> <description> Returns the given column's text alignment. @@ -623,12 +623,12 @@ Sets the given column's text value. </description> </method> - <method name="set_text_align"> + <method name="set_text_alignment"> <return type="void" /> <argument index="0" name="column" type="int" /> - <argument index="1" name="text_align" type="int" enum="TreeItem.TextAlign" /> + <argument index="1" name="text_alignment" type="int" enum="HorizontalAlignment" /> <description> - Sets the given column's text alignment. See [enum TextAlign] for possible values. + Sets the given column's text alignment. See [enum HorizontalAlignment] for possible values. </description> </method> <method name="set_text_direction"> @@ -679,14 +679,5 @@ </constant> <constant name="CELL_MODE_CUSTOM" value="4" enum="TreeCellMode"> </constant> - <constant name="ALIGN_LEFT" value="0" enum="TextAlign"> - Align text to the left. See [code]set_text_align()[/code]. - </constant> - <constant name="ALIGN_CENTER" value="1" enum="TextAlign"> - Center text. See [code]set_text_align()[/code]. - </constant> - <constant name="ALIGN_RIGHT" value="2" enum="TextAlign"> - Align text to the right. See [code]set_text_align()[/code]. - </constant> </constants> </class> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 044460f569..0bb64fb845 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -162,7 +162,7 @@ <method name="get_history_count"> <return type="int" /> <description> - Return how many elements are in the history. + Returns how many elements are in the history. </description> </method> <method name="get_version" qualifiers="const"> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index f3c2d743b6..7e773a0249 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -271,7 +271,7 @@ <return type="Vector2" /> <argument index="0" name="n" type="Vector2" /> <description> - Returns the vector reflected from a plane defined by the given normal. + Returns the vector reflected (ie mirrored, or symmetric) over a line defined by the given direction vector [code]n[/code]. </description> </method> <method name="rotated" qualifiers="const"> diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml index 951f4f8275..17a9e9f7da 100644 --- a/doc/classes/VehicleWheel3D.xml +++ b/doc/classes/VehicleWheel3D.xml @@ -11,6 +11,13 @@ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link> </tutorials> <methods> + <method name="get_contact_body" qualifiers="const"> + <return type="Node3D" /> + <description> + Returns the contacting body node if valid in the tree, as [Node3D]. At the moment, [GridMap] is not supported so the node will be always of type [PhysicsBody3D]. + Returns [code]null[/code] if the wheel is not in contact with a surface, or the contact body is not a [PhysicsBody3D]. + </description> + </method> <method name="get_rpm" qualifiers="const"> <return type="float" /> <description> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 4a3f99696d..4a11fbb489 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -215,7 +215,10 @@ </member> <member name="handle_input_locally" type="bool" setter="set_handle_input_locally" getter="is_handling_input_locally" default="true"> </member> - <member name="lod_threshold" type="float" setter="set_lod_threshold" getter="get_lod_threshold" default="1.0"> + <member name="mesh_lod_threshold" type="float" setter="set_mesh_lod_threshold" getter="get_mesh_lod_threshold" default="1.0"> + The automatic LOD bias to use for meshes rendered within the [Viewport] (this is analogous to [member ReflectionProbe.mesh_lod_threshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to [code]0.0[/code], automatic LOD is disabled. Increase [member mesh_lod_threshold] to improve performance at the cost of geometry detail. + To control this property on the root viewport, set the [member ProjectSettings.rendering/mesh_lod/lod_change/threshold_pixels] project setting. + [b]Note:[/b] [member mesh_lod_threshold] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD). </member> <member name="msaa" type="int" setter="set_msaa" getter="get_msaa" enum="Viewport.MSAA" default="0"> The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. See also bilinear scaling 3d [member scaling_3d_mode] for supersampling, which provides higher quality but is much more expensive. @@ -406,29 +409,32 @@ <constant name="DEBUG_DRAW_SSAO" value="12" enum="DebugDraw"> Draws the screen-space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment]. </constant> - <constant name="DEBUG_DRAW_PSSM_SPLITS" value="13" enum="DebugDraw"> + <constant name="DEBUG_DRAW_SSIL" value="13" enum="DebugDraw"> + Draws the screen-space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssil_enabled] set in your [WorldEnvironment]. + </constant> + <constant name="DEBUG_DRAW_PSSM_SPLITS" value="14" enum="DebugDraw"> Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order, they will be colored red, green, blue, and yellow. </constant> - <constant name="DEBUG_DRAW_DECAL_ATLAS" value="14" enum="DebugDraw"> + <constant name="DEBUG_DRAW_DECAL_ATLAS" value="15" enum="DebugDraw"> Draws the decal atlas used by [Decal]s and light projector textures in the upper left quadrant of the [Viewport]. </constant> - <constant name="DEBUG_DRAW_SDFGI" value="15" enum="DebugDraw"> + <constant name="DEBUG_DRAW_SDFGI" value="16" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_SDFGI_PROBES" value="16" enum="DebugDraw"> + <constant name="DEBUG_DRAW_SDFGI_PROBES" value="17" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_GI_BUFFER" value="17" enum="DebugDraw"> + <constant name="DEBUG_DRAW_GI_BUFFER" value="18" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_DISABLE_LOD" value="18" enum="DebugDraw"> + <constant name="DEBUG_DRAW_DISABLE_LOD" value="19" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="19" enum="DebugDraw"> + <constant name="DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="20" enum="DebugDraw"> + <constant name="DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_CLUSTER_DECALS" value="21" enum="DebugDraw"> + <constant name="DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="22" enum="DebugDraw"> + <constant name="DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="DebugDraw"> </constant> - <constant name="DEBUG_DRAW_OCCLUDERS" value="23" enum="DebugDraw"> + <constant name="DEBUG_DRAW_OCCLUDERS" value="24" enum="DebugDraw"> </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="0" enum="DefaultCanvasItemTextureFilter"> 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/VisualShaderNodeTextureUniform.xml b/doc/classes/VisualShaderNodeTextureUniform.xml index 26c72d2714..8da4325564 100644 --- a/doc/classes/VisualShaderNodeTextureUniform.xml +++ b/doc/classes/VisualShaderNodeTextureUniform.xml @@ -12,6 +12,12 @@ <member name="color_default" type="int" setter="set_color_default" getter="get_color_default" enum="VisualShaderNodeTextureUniform.ColorDefault" default="0"> Sets the default color if no texture is assigned to the uniform. </member> + <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="VisualShaderNodeTextureUniform.TextureFilter" default="0"> + Sets the texture filtering mode. See [enum TextureFilter] for options. + </member> + <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="VisualShaderNodeTextureUniform.TextureRepeat" default="0"> + Sets the texture repeating mode. See [enum TextureRepeat] for options. + </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeTextureUniform.TextureType" default="0"> Defines the type of data provided by the source texture. See [enum TextureType] for options. </member> @@ -26,8 +32,8 @@ <constant name="TYPE_NORMAL_MAP" value="2" enum="TextureType"> Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. </constant> - <constant name="TYPE_ANISO" value="3" enum="TextureType"> - Adds [code]hint_aniso[/code] as hint to the uniform declaration to use for a flowmap. + <constant name="TYPE_ANISOTROPY" value="3" enum="TextureType"> + Adds [code]hint_anisotropy[/code] as hint to the uniform declaration to use for a flowmap. </constant> <constant name="TYPE_MAX" value="4" enum="TextureType"> Represents the size of the [enum TextureType] enum. @@ -41,5 +47,31 @@ <constant name="COLOR_DEFAULT_MAX" value="2" enum="ColorDefault"> Represents the size of the [enum ColorDefault] enum. </constant> + <constant name="FILTER_DEFAULT" value="0" enum="TextureFilter"> + </constant> + <constant name="FILTER_NEAREST" value="1" enum="TextureFilter"> + </constant> + <constant name="FILTER_LINEAR" value="2" enum="TextureFilter"> + </constant> + <constant name="FILTER_NEAREST_MIPMAP" value="3" enum="TextureFilter"> + </constant> + <constant name="FILTER_LINEAR_MIPMAP" value="4" enum="TextureFilter"> + </constant> + <constant name="FILTER_NEAREST_MIPMAP_ANISOTROPIC" value="5" enum="TextureFilter"> + </constant> + <constant name="FILTER_LINEAR_MIPMAP_ANISOTROPIC" value="6" enum="TextureFilter"> + </constant> + <constant name="FILTER_MAX" value="7" enum="TextureFilter"> + Represents the size of the [enum TextureFilter] enum. + </constant> + <constant name="REPEAT_DEFAULT" value="0" enum="TextureRepeat"> + </constant> + <constant name="REPEAT_ENABLED" value="1" enum="TextureRepeat"> + </constant> + <constant name="REPEAT_DISABLED" value="2" enum="TextureRepeat"> + </constant> + <constant name="REPEAT_MAX" value="3" enum="TextureRepeat"> + Represents the size of the [enum TextureRepeat] enum. + </constant> </constants> </class> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index c7ca6a20be..75161d3c5b 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -287,6 +287,8 @@ </member> <member name="content_scale_aspect" type="int" setter="set_content_scale_aspect" getter="get_content_scale_aspect" enum="Window.ContentScaleAspect" default="0"> </member> + <member name="content_scale_factor" type="float" setter="set_content_scale_factor" getter="get_content_scale_factor" default="1.0"> + </member> <member name="content_scale_mode" type="int" setter="set_content_scale_mode" getter="get_content_scale_mode" enum="Window.ContentScaleMode" default="0"> </member> <member name="content_scale_size" type="Vector2i" setter="set_content_scale_size" getter="get_content_scale_size" default="Vector2i(0, 0)"> |