diff options
Diffstat (limited to 'doc')
28 files changed, 356 insertions, 403 deletions
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 7696f36009..8a94eee54c 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -275,7 +275,8 @@ <argument index="1" name="new_name" type="StringName"> </argument> <description> - If the currently being played animation changes, this signal will notify of such change. + Emitted when a queued animation plays after the previous animation was finished. See [method queue]. + [b]Note:[/b] The signal is not emitted when the animation is changed via [method play] or from [AnimationTree]. </description> </signal> <signal name="animation_finished"> diff --git a/doc/classes/AudioEffectPitchShift.xml b/doc/classes/AudioEffectPitchShift.xml index 917556fded..9c28a01650 100644 --- a/doc/classes/AudioEffectPitchShift.xml +++ b/doc/classes/AudioEffectPitchShift.xml @@ -13,23 +13,30 @@ </methods> <members> <member name="fft_size" type="int" setter="set_fft_size" getter="get_fft_size" enum="AudioEffectPitchShift.FFTSize" default="3"> + The size of the [url=https://en.wikipedia.org/wiki/Fast_Fourier_transform]Fast Fourier transform[/url] buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes. </member> <member name="oversampling" type="int" setter="set_oversampling" getter="get_oversampling" default="4"> + The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up. </member> <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0"> - Pitch value. Can range from 0 (-1 octave) to 16 (+16 octaves). + The pitch scale to use. [code]1.0[/code] is the default pitch and plays sounds unaltered. [member pitch_scale] can range from [code]0.0[/code] (infinitely low pitch, inaudible) to [code]16[/code] (16 times higher than the initial pitch). </member> </members> <constants> <constant name="FFT_SIZE_256" value="0" enum="FFTSize"> + Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. </constant> <constant name="FFT_SIZE_512" value="1" enum="FFTSize"> + Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. </constant> <constant name="FFT_SIZE_1024" value="2" enum="FFTSize"> + Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. </constant> <constant name="FFT_SIZE_2048" value="3" enum="FFTSize"> + Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. </constant> <constant name="FFT_SIZE_4096" value="4" enum="FFTSize"> + Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. </constant> <constant name="FFT_SIZE_MAX" value="5" enum="FFTSize"> Represents the size of the [enum FFTSize] enum. diff --git a/doc/classes/AudioEffectSpectrumAnalyzer.xml b/doc/classes/AudioEffectSpectrumAnalyzer.xml index 79a8932e25..10d29ff8ab 100644 --- a/doc/classes/AudioEffectSpectrumAnalyzer.xml +++ b/doc/classes/AudioEffectSpectrumAnalyzer.xml @@ -1,31 +1,43 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioEffectSpectrumAnalyzer" inherits="AudioEffect" version="4.0"> <brief_description> + Audio effect that can be used for real-time audio visualizations. </brief_description> <description> + This audio effect does not affect sound output, but can be used for real-time audio visualizations. + See also [AudioStreamGenerator] for procedurally generating sounds. </description> <tutorials> + <link title="https://godotengine.org/asset-library/asset/528">Audio Spectrum Demo</link> + <link title="https://godotengine.org/article/godot-32-will-get-new-audio-features">Godot 3.2 will get new audio features</link> </tutorials> <methods> </methods> <members> <member name="buffer_length" type="float" setter="set_buffer_length" getter="get_buffer_length" default="2.0"> + The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory. </member> <member name="fft_size" type="int" setter="set_fft_size" getter="get_fft_size" enum="AudioEffectSpectrumAnalyzer.FFTSize" default="2"> + The size of the [url=https://en.wikipedia.org/wiki/Fast_Fourier_transform]Fast Fourier transform[/url] buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes. </member> <member name="tap_back_pos" type="float" setter="set_tap_back_pos" getter="get_tap_back_pos" default="0.01"> </member> </members> <constants> <constant name="FFT_SIZE_256" value="0" enum="FFTSize"> + Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. </constant> <constant name="FFT_SIZE_512" value="1" enum="FFTSize"> + Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. </constant> <constant name="FFT_SIZE_1024" value="2" enum="FFTSize"> + Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. </constant> <constant name="FFT_SIZE_2048" value="3" enum="FFTSize"> + Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. </constant> <constant name="FFT_SIZE_4096" value="4" enum="FFTSize"> + Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. </constant> <constant name="FFT_SIZE_MAX" value="5" enum="FFTSize"> Represents the size of the [enum FFTSize] enum. diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml index a273beb5af..8464bc8a85 100644 --- a/doc/classes/AudioStreamGenerator.xml +++ b/doc/classes/AudioStreamGenerator.xml @@ -1,18 +1,27 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamGenerator" inherits="AudioStream" version="4.0"> <brief_description> + Audio stream that generates sounds procedurally. </brief_description> <description> + This audio stream does not play back sounds, but expects a script to generate audio data for it instead. See also [AudioStreamGeneratorPlayback]. + See also [AudioEffectSpectrumAnalyzer] for performing real-time audio spectrum analysis. + [b]Note:[/b] Due to performance constraints, this class is best used from C# or from a compiled language via GDNative. If you still want to use this class from GDScript, consider using a lower [member mix_rate] such as 11,025 Hz or 22,050 Hz. </description> <tutorials> <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> + <link title="https://godotengine.org/article/godot-32-will-get-new-audio-features">Godot 3.2 will get new audio features</link> </tutorials> <methods> </methods> <members> <member name="buffer_length" type="float" setter="set_buffer_length" getter="get_buffer_length" default="0.5"> + The length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up. </member> <member name="mix_rate" type="float" setter="set_mix_rate" getter="get_mix_rate" default="44100.0"> + The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality. + In games, common sample rates in use are [code]11025[/code], [code]16000[/code], [code]22050[/code], [code]32000[/code], [code]44100[/code], and [code]48000[/code]. + According to the [url=https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem]Nyquist-Shannon sampling theorem[/url], there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as [code]32000[/code] or [code]22050[/code] may be usable with no loss in quality. </member> </members> <constants> diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml index cd8e8735b6..503f72a048 100644 --- a/doc/classes/AudioStreamGeneratorPlayback.xml +++ b/doc/classes/AudioStreamGeneratorPlayback.xml @@ -1,11 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AudioStreamGeneratorPlayback" inherits="AudioStreamPlaybackResampled" version="4.0"> <brief_description> + Plays back audio generated using [AudioStreamGenerator]. </brief_description> <description> + This class is meant to be used with [AudioStreamGenerator] to play back the generated audio in real-time. </description> <tutorials> - <link title="Audio generator demo project">https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link> + <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link> + <link title="https://godotengine.org/article/godot-32-will-get-new-audio-features">Godot 3.2 will get new audio features</link> </tutorials> <methods> <method name="can_push_buffer" qualifiers="const"> @@ -14,18 +17,21 @@ <argument index="0" name="amount" type="int"> </argument> <description> + Returns [code]true[/code] if a buffer of the size [code]amount[/code] can be pushed to the audio sample data buffer without overflowing it, [code]false[/code] otherwise. </description> </method> <method name="clear_buffer"> <return type="void"> </return> <description> + Clears the audio sample data buffer. </description> </method> <method name="get_frames_available" qualifiers="const"> <return type="int"> </return> <description> + Returns the number of audio data frames left to play. If this returned number reaches [code]0[/code], the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking. </description> </method> <method name="get_skips" qualifiers="const"> @@ -40,6 +46,7 @@ <argument index="0" name="frames" type="PackedVector2Array"> </argument> <description> + Pushes several audio data frames to the buffer. This is usually more efficient than [method push_frame] in C# and compiled languages via GDNative, but [method push_buffer] may be [i]less[/i] efficient in GDScript. </description> </method> <method name="push_frame"> @@ -48,6 +55,7 @@ <argument index="0" name="frame" type="Vector2"> </argument> <description> + Pushes a single audio data frame to the buffer. This is usually less efficient than [method push_buffer] in C# and compiled languages via GDNative, but [method push_frame] may be [i]more[/i] efficient in GDScript. </description> </method> </methods> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index c12e1bd05c..d07b1ac66d 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -5,7 +5,7 @@ </brief_description> <description> AudioStreamSample stores sound samples loaded from WAV files. To play the stored sound, use an [AudioStreamPlayer] (for non-positional audio) or [AudioStreamPlayer2D]/[AudioStreamPlayer3D] (for positional audio). The sound can be looped. - This class can also be used to store dynamically-generated PCM audio data. + This class can also be used to store dynamically-generated PCM audio data. See also [AudioStreamGenerator] for procedural audio generation. </description> <tutorials> </tutorials> @@ -39,7 +39,9 @@ The loop mode. This information will be imported automatically from the WAV file if present. See [enum LoopMode] constants for values. </member> <member name="mix_rate" type="int" setter="set_mix_rate" getter="get_mix_rate" default="44100"> - The sample rate for mixing this audio. + The sample rate for mixing this audio. Higher values require more storage space, but result in better quality. + In games, common sample rates in use are [code]11025[/code], [code]16000[/code], [code]22050[/code], [code]32000[/code], [code]44100[/code], and [code]48000[/code]. + According to the [url=https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem]Nyquist-Shannon sampling theorem[/url], there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as [code]32000[/code] or [code]22050[/code] may be usable with no loss in quality. </member> <member name="stereo" type="bool" setter="set_stereo" getter="is_stereo" default="false"> If [code]true[/code], audio is stereo. diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index 30f6c2b951..016eb05308 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -55,10 +55,19 @@ <argument index="0" name="world_point" type="Vector3"> </argument> <description> - Returns [code]true[/code] if the given position is behind the camera. + Returns [code]true[/code] if the given position is behind the camera (the blue part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. [b]Note:[/b] A position which returns [code]false[/code] may still be outside the camera's field of view. </description> </method> + <method name="is_position_in_frustum" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="world_point" type="Vector3"> + </argument> + <description> + Returns [code]true[/code] if the given position is inside the camera's frustum (the green part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. + </description> + </method> <method name="make_current"> <return type="void"> </return> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 87b157db4e..f15bc14be3 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -24,6 +24,21 @@ Overridable function called by the engine (if defined) to draw the canvas item. </description> </method> + <method name="draw_animation_slice"> + <return type="void"> + </return> + <argument index="0" name="animation_length" type="float"> + </argument> + <argument index="1" name="slice_begin" type="float"> + </argument> + <argument index="2" name="slice_end" type="float"> + </argument> + <argument index="3" name="offset" type="float" default="0.0"> + </argument> + <description> + Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly. + </description> + </method> <method name="draw_arc"> <return type="void"> </return> @@ -98,6 +113,13 @@ Draws a colored polygon of any amount of points, convex or concave. </description> </method> + <method name="draw_end_animation"> + <return type="void"> + </return> + <description> + After submitting all animations slices via [method draw_animation_slice], this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required. + </description> + </method> <method name="draw_line"> <return type="void"> </return> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 4076198df6..1250350971 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -86,6 +86,15 @@ Line only denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to [code]true[/code]. </description> </method> + <method name="can_fold_line" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block. + </description> + </method> <method name="cancel_code_completion"> <return type="void"> </return> @@ -134,6 +143,22 @@ Inserts the selected entry into the text. If [code]replace[/code] is true, any existing text is replaced rather then merged. </description> </method> + <method name="fold_all_lines"> + <return type="void"> + </return> + <description> + Folds all lines that are possible to be folded (see [method can_fold_line]). + </description> + </method> + <method name="fold_line"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Folds the given line, if possible (see [method can_fold_line]). + </description> + </method> <method name="get_bookmarked_lines" qualifiers="const"> <return type="Array"> </return> @@ -184,7 +209,7 @@ Gets the end key for a string or comment region index. </description> </method> - <method name="get_delimiter_end_postion" qualifiers="const"> + <method name="get_delimiter_end_position" qualifiers="const"> <return type="Vector2"> </return> <argument index="0" name="line" type="int"> @@ -204,7 +229,7 @@ Gets the start key for a string or comment region index. </description> </method> - <method name="get_delimiter_start_postion" qualifiers="const"> + <method name="get_delimiter_start_position" qualifiers="const"> <return type="Vector2"> </return> <argument index="0" name="line" type="int"> @@ -221,6 +246,13 @@ <description> </description> </method> + <method name="get_folded_lines" qualifiers="const"> + <return type="int[]"> + </return> + <description> + Return all lines that are current folded. + </description> + </method> <method name="get_text_for_code_completion" qualifiers="const"> <return type="String"> </return> @@ -292,6 +324,15 @@ <description> </description> </method> + <method name="is_line_folded" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Returns whether the line at the specified index is folded or not. + </description> + </method> <method name="remove_comment_delimiter"> <return type="void"> </return> @@ -376,6 +417,30 @@ <description> </description> </method> + <method name="toggle_foldable_line"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Toggle the folding of the code block at the given line. + </description> + </method> + <method name="unfold_all_lines"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="unfold_line"> + <return type="void"> + </return> + <argument index="0" name="line" type="int"> + </argument> + <description> + Unfolds all lines that were previously folded. + </description> + </method> <method name="update_code_completion_options"> <return type="void"> </return> @@ -411,6 +476,9 @@ <member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false"> </member> <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" override="true" enum="Control.LayoutDirection" default="2" /> + <member name="line_folding" type="bool" setter="set_line_folding_enabled" getter="is_line_folding_enabled" default="true"> + Sets whether line folding is allowed. + </member> <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" override="true" default="[ ]" /> <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" override="true" enum="Control.TextDirection" default="1" /> <member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false"> @@ -500,6 +568,8 @@ </theme_item> <theme_item name="folded" type="Texture2D"> </theme_item> + <theme_item name="folded_eol_icon" type="Texture2D"> + </theme_item> <theme_item name="font" type="Font"> </theme_item> <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 1147b52102..ab480c50ab 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -171,6 +171,7 @@ </member> <member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5"> Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. + [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics_jitter_fix] to [code]0[/code]. </member> <member name="target_fps" type="int" setter="set_target_fps" getter="get_target_fps" default="0"> The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit. diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index e41de4c4ed..0781d2ffa2 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -12,9 +12,9 @@ var expression = Expression.new() func _ready(): - $LineEdit.connect("text_entered", self, "_on_text_entered") + $LineEdit.connect("text_submitted", self, "_on_text_submitted") - func _on_text_entered(command): + func _on_text_submitted(command): var error = expression.parse(command) if error != OK: print(expression.get_error_text()) @@ -28,7 +28,7 @@ public override void _Ready() { - GetNode("LineEdit").Connect("text_entered", this, nameof(OnTextEntered)); + GetNode("LineEdit").Connect("text_submitted", this, nameof(OnTextEntered)); } private void OnTextEntered(string command) diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index b2c3bfc3ed..667ca2dacf 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -52,25 +52,21 @@ </member> <member name="lod_bias" type="float" setter="set_lod_bias" getter="get_lod_bias" default="1.0"> </member> - <member name="lod_max_distance" type="float" setter="set_lod_max_distance" getter="get_lod_max_distance" default="0.0"> - The GeometryInstance3D's max LOD distance. - [b]Note:[/b] This property currently has no effect. + <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override"> + The material override for the whole geometry. + If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. </member> - <member name="lod_max_hysteresis" type="float" setter="set_lod_max_hysteresis" getter="get_lod_max_hysteresis" default="0.0"> - The GeometryInstance3D's max LOD margin. - [b]Note:[/b] This property currently has no effect. + <member name="visibility_range_begin" type="float" setter="set_visibility_range_begin" getter="get_visibility_range_begin" default="0.0"> + Starting distance from which the GeometryInstance3D will be visible, taking [member visibility_range_begin_margin] into account as well. The default value of 0 is used to disable the range check. </member> - <member name="lod_min_distance" type="float" setter="set_lod_min_distance" getter="get_lod_min_distance" default="0.0"> - The GeometryInstance3D's min LOD distance. - [b]Note:[/b] This property currently has no effect. + <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. </member> - <member name="lod_min_hysteresis" type="float" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" default="0.0"> - The GeometryInstance3D's min LOD margin. - [b]Note:[/b] This property currently has no effect. + <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="material_override" type="Material" setter="set_material_override" getter="get_material_override"> - The material override for the whole geometry. - If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. + <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. </member> </members> <constants> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index b4536c0589..16fc1ca17a 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -197,6 +197,9 @@ <member name="scroll_offset" type="Vector2" setter="set_scroll_ofs" getter="get_scroll_ofs" default="Vector2( 0, 0 )"> The scroll offset. </member> + <member name="show_zoom_label" type="bool" setter="set_show_zoom_label" getter="is_showing_zoom_label" default="false"> + If [code]true[/code], makes a label with the current zoom level visible. The zoom value is displayed in percents. + </member> <member name="snap_distance" type="int" setter="set_snap" getter="get_snap" default="20"> The snapping distance in pixels. </member> @@ -206,6 +209,15 @@ <member name="zoom" type="float" setter="set_zoom" getter="get_zoom" default="1.0"> The current zoom value. </member> + <member name="zoom_max" type="float" setter="set_zoom_max" getter="get_zoom_max" default="2.0736"> + The upper zoom limit. + </member> + <member name="zoom_min" type="float" setter="set_zoom_min" getter="get_zoom_min" default="0.232568"> + The lower zoom limit. + </member> + <member name="zoom_step" type="float" setter="set_zoom_step" getter="get_zoom_step" default="1.2"> + The step of each zoom level. + </member> </members> <signals> <signal name="begin_node_move"> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 7adf19632e..e11ae7969a 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -248,7 +248,7 @@ Emitted when the text changes. </description> </signal> - <signal name="text_entered"> + <signal name="text_submitted"> <argument index="0" name="new_text" type="String"> </argument> <description> diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index a6237708c6..1c161803db 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -20,7 +20,7 @@ Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> - <method name="get_parent_spatial" qualifiers="const"> + <method name="get_parent_node_3d" qualifiers="const"> <return type="Node3D"> </return> <description> @@ -310,6 +310,9 @@ <member name="transform" type="Transform3D" setter="set_transform" getter="get_transform" default="Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> Local space [Transform3D] of this node, with respect to the parent node. </member> + <member name="visibility_parent" type="NodePath" setter="set_visibility_parent" getter="get_visibility_parent" default="NodePath("")"> + Defines the visibility range parent for this node and its subtree. The visibility parent must be a GeometryInstance3D. Any visual instance will only be visible if the visibility parent (and all of its visibility ancestors) is hidden by being closer to the camera than its own [member GeometryInstance3D.visibility_range_begin]. Nodes hidden via the [member Node3D.visible] property are essentially removed from the visibility dependency tree, so dependant instances will not take the hidden node or its ancestors into account. + </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true"> If [code]true[/code], this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). </member> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 360ccc597e..35656d170b 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -309,7 +309,7 @@ If [code]true[/code], microphone input will be allowed. This requires appropriate permissions to be set when exporting to Android or iOS. </member> <member name="audio/driver/mix_rate" type="int" setter="" getter="" default="44100"> - Mixing rate used for audio. In general, it's better to not touch this and leave it to the host operating system. + The mixing rate used for audio (in Hz). In general, it's better to not touch this and leave it to the host operating system. </member> <member name="audio/driver/output_latency" type="int" setter="" getter="" default="15"> Output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware. @@ -739,6 +739,8 @@ If no selection is currently active, selects the word currently under the caret in text fields. If a selection is currently active, deselects the current selection. [b]Note:[/b] Currently, this is only implemented in [TextEdit], not [LineEdit]. </member> + <member name="input/ui_text_submit" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_text_toggle_insert_mode" type="Dictionary" setter="" getter=""> </member> <member name="input/ui_undo" type="Dictionary" setter="" getter=""> @@ -1311,7 +1313,8 @@ [b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.iterations_per_second] instead. </member> <member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5"> - Fix to improve physics jitter, specially on monitors where refresh rate is different than the physics FPS. + Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. + [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0[/code]. [b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.physics_jitter_fix] instead. </member> <member name="rendering/2d/sdf/oversize" type="int" setter="" getter="" default="1"> @@ -1615,9 +1618,6 @@ <member name="rendering/xr/enabled" type="bool" setter="" getter="" default="false"> If [code]true[/code], XR support is enabled in Godot, this ensures required shaders are compiled. </member> - <member name="world/2d/cell_size" type="int" setter="" getter="" default="100"> - Cell size used for the 2D hash grid that [VisibilityNotifier2D] uses (in pixels). - </member> </members> <constants> </constants> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index ba19176788..300108ff77 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1175,17 +1175,6 @@ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. </description> </method> - <method name="instance_geometry_set_as_instance_lod"> - <return type="void"> - </return> - <argument index="0" name="instance" type="RID"> - </argument> - <argument index="1" name="as_lod_of_instance" type="RID"> - </argument> - <description> - Not implemented in Godot 3.x. - </description> - </method> <method name="instance_geometry_set_cast_shadows_setting"> <return type="void"> </return> @@ -1197,45 +1186,45 @@ Sets the shadow casting setting to one of [enum ShadowCastingSetting]. Equivalent to [member GeometryInstance3D.cast_shadow]. </description> </method> - <method name="instance_geometry_set_draw_range"> + <method name="instance_geometry_set_flag"> <return type="void"> </return> <argument index="0" name="instance" type="RID"> </argument> - <argument index="1" name="min" type="float"> - </argument> - <argument index="2" name="max" type="float"> - </argument> - <argument index="3" name="min_margin" type="float"> + <argument index="1" name="flag" type="int" enum="RenderingServer.InstanceFlags"> </argument> - <argument index="4" name="max_margin" type="float"> + <argument index="2" name="enabled" type="bool"> </argument> <description> - Not implemented in Godot 3.x. + Sets the flag for a given [enum InstanceFlags]. See [enum InstanceFlags] for more details. </description> </method> - <method name="instance_geometry_set_flag"> + <method name="instance_geometry_set_material_override"> <return type="void"> </return> <argument index="0" name="instance" type="RID"> </argument> - <argument index="1" name="flag" type="int" enum="RenderingServer.InstanceFlags"> - </argument> - <argument index="2" name="enabled" type="bool"> + <argument index="1" name="material" type="RID"> </argument> <description> - Sets the flag for a given [enum InstanceFlags]. See [enum InstanceFlags] for more details. + Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to [member GeometryInstance3D.material_override]. </description> </method> - <method name="instance_geometry_set_material_override"> + <method name="instance_geometry_set_visibility_range"> <return type="void"> </return> <argument index="0" name="instance" type="RID"> </argument> - <argument index="1" name="material" type="RID"> + <argument index="1" name="min" type="float"> + </argument> + <argument index="2" name="max" type="float"> + </argument> + <argument index="3" name="min_margin" type="float"> + </argument> + <argument index="4" name="max_margin" type="float"> </argument> <description> - Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to [member GeometryInstance3D.material_override]. + Sets the visibility range values for the given geometry instance. Equivalent to [member GeometryInstance3D.visibility_range_begin] and related properties. </description> </method> <method name="instance_set_base"> @@ -1341,6 +1330,17 @@ Sets the world space transform of the instance. Equivalent to [member Node3D.transform]. </description> </method> + <method name="instance_set_visibility_parent"> + <return type="void"> + </return> + <argument index="0" name="instance" type="RID"> + </argument> + <argument index="1" name="parent" type="RID"> + </argument> + <description> + Sets the visibility parent for the given instance. Equivalent to [member Node3D.visibility_parent]. + </description> + </method> <method name="instance_set_visible"> <return type="void"> </return> @@ -3702,7 +3702,7 @@ </constant> <constant name="INSTANCE_OCCLUDER" value="11" enum="InstanceType"> </constant> - <constant name="INSTANCE_MAX" value="12" enum="InstanceType"> + <constant name="INSTANCE_MAX" value="13" enum="InstanceType"> Represents the size of the [enum InstanceType] enum. </constant> <constant name="INSTANCE_GEOMETRY_MASK" value="30" enum="InstanceType"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 74811318dc..2d6a052fe3 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -18,15 +18,6 @@ <description> </description> </method> - <method name="can_fold" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Returns if the given line is foldable, that is, it has indented lines right below it. - </description> - </method> <method name="center_viewport_to_cursor"> <return type="void"> </return> @@ -95,7 +86,7 @@ <description> Moves the cursor at the specified [code]line[/code] index. If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs. - If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. + If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden. </description> </method> <method name="cut"> @@ -112,22 +103,6 @@ Deselects the current selection. </description> </method> - <method name="fold_all_lines"> - <return type="void"> - </return> - <description> - Folds all lines that are possible to be folded (see [method can_fold]). - </description> - </method> - <method name="fold_line"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Folds the given line, if possible (see [method can_fold]). - </description> - </method> <method name="get_caret_draw_pos" qualifiers="const"> <return type="Vector2"> </return> @@ -329,15 +304,6 @@ Returns [code]true[/code] if the caret is visible on the screen. </description> </method> - <method name="is_folded" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Returns whether the line at the specified index is folded or not. - </description> - </method> <method name="is_gutter_clickable" qualifiers="const"> <return type="bool"> </return> @@ -372,15 +338,6 @@ <description> </description> </method> - <method name="is_line_hidden" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Returns whether the line at the specified index is hidden or not. - </description> - </method> <method name="is_selection_active" qualifiers="const"> <return type="bool"> </return> @@ -560,17 +517,6 @@ Sets the text for a specific line. </description> </method> - <method name="set_line_as_hidden"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <argument index="1" name="enable" type="bool"> - </argument> - <description> - If [code]true[/code], hides the line of the specified index. - </description> - </method> <method name="set_line_background_color"> <return type="void"> </return> @@ -665,15 +611,6 @@ <description> </description> </method> - <method name="toggle_fold_line"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Toggle the folding of the code block at the given line. - </description> - </method> <method name="undo"> <return type="void"> </return> @@ -681,22 +618,6 @@ Perform undo operation. </description> </method> - <method name="unfold_line"> - <return type="void"> - </return> - <argument index="0" name="line" type="int"> - </argument> - <description> - Unfolds the given line, if folded. - </description> - </method> - <method name="unhide_all_lines"> - <return type="void"> - </return> - <description> - Unhide all lines that were previously set to hidden by [method set_line_as_hidden]. - </description> - </method> </methods> <members> <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false"> @@ -730,9 +651,6 @@ If [code]true[/code], the "tab" character will have a visible representation. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> - <member name="hiding_enabled" type="bool" setter="set_hiding_enabled" getter="is_hiding_enabled" default="false"> - If [code]true[/code], all lines that have been set to hidden by [method set_line_as_hidden], will not be visible. - </member> <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled" default="false"> If [code]true[/code], all occurrences of the selected text will be highlighted. </member> @@ -972,8 +890,6 @@ </theme_item> <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> - <theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )"> - </theme_item> <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )"> Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. </theme_item> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 96d63b27ad..292be34a0d 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -179,13 +179,6 @@ <description> </description> </method> - <method name="update_worlds"> - <return type="void"> - </return> - <description> - Forces update of the 2D and 3D worlds. - </description> - </method> <method name="warp_mouse"> <return type="void"> </return> diff --git a/doc/classes/VisibilityEnabler2D.xml b/doc/classes/VisibilityEnabler2D.xml deleted file mode 100644 index 02fe7a7cd0..0000000000 --- a/doc/classes/VisibilityEnabler2D.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityEnabler2D" inherits="VisibilityNotifier2D" version="4.0"> - <brief_description> - Enables certain nodes only when approximately visible. - </brief_description> - <description> - The VisibilityEnabler2D will disable [RigidBody2D], [AnimationPlayer], and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself. - If you just want to receive notifications, use [VisibilityNotifier2D] instead. - [b]Note:[/b] For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need precise visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node. - [b]Note:[/b] VisibilityEnabler2D will not affect nodes added after scene initialization. - </description> - <tutorials> - </tutorials> - <methods> - <method name="is_enabler_enabled" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="enabler" type="int" enum="VisibilityEnabler2D.Enabler"> - </argument> - <description> - Returns whether the enabler identified by given [enum Enabler] constant is active. - </description> - </method> - <method name="set_enabler"> - <return type="void"> - </return> - <argument index="0" name="enabler" type="int" enum="VisibilityEnabler2D.Enabler"> - </argument> - <argument index="1" name="enabled" type="bool"> - </argument> - <description> - Sets active state of the enabler identified by given [enum Enabler] constant. - </description> - </method> - </methods> - <members> - <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [RigidBody2D] nodes will be paused. - </member> - <member name="pause_animated_sprites" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [AnimatedSprite2D] nodes will be paused. - </member> - <member name="pause_animations" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [AnimationPlayer] nodes will be paused. - </member> - <member name="pause_particles" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [GPUParticles2D] nodes will be paused. - </member> - <member name="physics_process_parent" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="false"> - If [code]true[/code], the parent's [method Node._physics_process] will be stopped. - </member> - <member name="process_parent" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="false"> - If [code]true[/code], the parent's [method Node._process] will be stopped. - </member> - </members> - <constants> - <constant name="ENABLER_PAUSE_ANIMATIONS" value="0" enum="Enabler"> - This enabler will pause [AnimationPlayer] nodes. - </constant> - <constant name="ENABLER_FREEZE_BODIES" value="1" enum="Enabler"> - This enabler will freeze [RigidBody2D] nodes. - </constant> - <constant name="ENABLER_PAUSE_PARTICLES" value="2" enum="Enabler"> - This enabler will stop [GPUParticles2D] nodes. - </constant> - <constant name="ENABLER_PARENT_PROCESS" value="3" enum="Enabler"> - This enabler will stop the parent's _process function. - </constant> - <constant name="ENABLER_PARENT_PHYSICS_PROCESS" value="4" enum="Enabler"> - This enabler will stop the parent's _physics_process function. - </constant> - <constant name="ENABLER_PAUSE_ANIMATED_SPRITES" value="5" enum="Enabler"> - This enabler will stop [AnimatedSprite2D] nodes animations. - </constant> - <constant name="ENABLER_MAX" value="6" enum="Enabler"> - Represents the size of the [enum Enabler] enum. - </constant> - </constants> -</class> diff --git a/doc/classes/VisibilityEnabler3D.xml b/doc/classes/VisibilityEnabler3D.xml deleted file mode 100644 index d78ebb55f2..0000000000 --- a/doc/classes/VisibilityEnabler3D.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityEnabler3D" inherits="VisibilityNotifier3D" version="4.0"> - <brief_description> - Enables certain nodes only when approximately visible. - </brief_description> - <description> - The VisibilityEnabler3D will disable [RigidBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler3D itself. - If you just want to receive notifications, use [VisibilityNotifier3D] instead. - [b]Note:[/b] VisibilityEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. - [b]Note:[/b] VisibilityEnabler3D will not affect nodes added after scene initialization. - </description> - <tutorials> - </tutorials> - <methods> - <method name="is_enabler_enabled" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="enabler" type="int" enum="VisibilityEnabler3D.Enabler"> - </argument> - <description> - Returns whether the enabler identified by given [enum Enabler] constant is active. - </description> - </method> - <method name="set_enabler"> - <return type="void"> - </return> - <argument index="0" name="enabler" type="int" enum="VisibilityEnabler3D.Enabler"> - </argument> - <argument index="1" name="enabled" type="bool"> - </argument> - <description> - Sets active state of the enabler identified by given [enum Enabler] constant. - </description> - </method> - </methods> - <members> - <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [RigidBody3D] nodes will be paused. - </member> - <member name="pause_animations" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> - If [code]true[/code], [AnimationPlayer] nodes will be paused. - </member> - </members> - <constants> - <constant name="ENABLER_PAUSE_ANIMATIONS" value="0" enum="Enabler"> - This enabler will pause [AnimationPlayer] nodes. - </constant> - <constant name="ENABLER_FREEZE_BODIES" value="1" enum="Enabler"> - This enabler will freeze [RigidBody3D] nodes. - </constant> - <constant name="ENABLER_MAX" value="2" enum="Enabler"> - Represents the size of the [enum Enabler] enum. - </constant> - </constants> -</class> diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml deleted file mode 100644 index 761438b77e..0000000000 --- a/doc/classes/VisibilityNotifier2D.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityNotifier2D" inherits="Node2D" version="4.0"> - <brief_description> - Detects approximately when the node is visible on screen. - </brief_description> - <description> - The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. - If you want nodes to be disabled automatically when they exit the screen, use [VisibilityEnabler2D] instead. - [b]Note:[/b] For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need precise visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node. - </description> - <tutorials> - <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> - </tutorials> - <methods> - <method name="is_on_screen" qualifiers="const"> - <return type="bool"> - </return> - <description> - If [code]true[/code], the bounding rectangle is on the screen. - [b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. - </description> - </method> - </methods> - <members> - <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" default="Rect2( -10, -10, 20, 20 )"> - The VisibilityNotifier2D's bounding rectangle. - </member> - </members> - <signals> - <signal name="screen_entered"> - <description> - Emitted when the VisibilityNotifier2D enters the screen. - </description> - </signal> - <signal name="screen_exited"> - <description> - Emitted when the VisibilityNotifier2D exits the screen. - </description> - </signal> - <signal name="viewport_entered"> - <argument index="0" name="viewport" type="Viewport"> - </argument> - <description> - Emitted when the VisibilityNotifier2D enters a [Viewport]'s view. - </description> - </signal> - <signal name="viewport_exited"> - <argument index="0" name="viewport" type="Viewport"> - </argument> - <description> - Emitted when the VisibilityNotifier2D exits a [Viewport]'s view. - </description> - </signal> - </signals> - <constants> - </constants> -</class> diff --git a/doc/classes/VisibilityNotifier3D.xml b/doc/classes/VisibilityNotifier3D.xml deleted file mode 100644 index e5d3116612..0000000000 --- a/doc/classes/VisibilityNotifier3D.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityNotifier3D" inherits="Node3D" version="4.0"> - <brief_description> - Detects approximately when the node is visible on screen. - </brief_description> - <description> - The VisibilityNotifier3D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera3D]'s view. - If you want nodes to be disabled automatically when they exit the screen, use [VisibilityEnabler3D] instead. - [b]Note:[/b] VisibilityNotifier3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. - </description> - <tutorials> - </tutorials> - <methods> - <method name="is_on_screen" qualifiers="const"> - <return type="bool"> - </return> - <description> - If [code]true[/code], the bounding box is on the screen. - [b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. - </description> - </method> - </methods> - <members> - <member name="aabb" type="AABB" setter="set_aabb" getter="get_aabb" default="AABB( -1, -1, -1, 2, 2, 2 )"> - The VisibilityNotifier3D's bounding box. - </member> - </members> - <signals> - <signal name="camera_entered"> - <argument index="0" name="camera" type="Camera3D"> - </argument> - <description> - Emitted when the VisibilityNotifier3D enters a [Camera3D]'s view. - </description> - </signal> - <signal name="camera_exited"> - <argument index="0" name="camera" type="Camera3D"> - </argument> - <description> - Emitted when the VisibilityNotifier3D exits a [Camera3D]'s view. - </description> - </signal> - <signal name="screen_entered"> - <description> - Emitted when the VisibilityNotifier3D enters the screen. - </description> - </signal> - <signal name="screen_exited"> - <description> - Emitted when the VisibilityNotifier3D exits the screen. - </description> - </signal> - </signals> - <constants> - </constants> -</class> diff --git a/doc/classes/VisibleOnScreenEnabler2D.xml b/doc/classes/VisibleOnScreenEnabler2D.xml new file mode 100644 index 0000000000..c6ae8227d2 --- /dev/null +++ b/doc/classes/VisibleOnScreenEnabler2D.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisibleOnScreenEnabler2D" inherits="VisibleOnScreenNotifier2D" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibleOnScreenEnabler2D.EnableMode" default="0"> + </member> + <member name="enable_node_path" type="NodePath" setter="set_enable_node_path" getter="get_enable_node_path" default="NodePath("..")"> + </member> + </members> + <constants> + <constant name="ENABLE_MODE_INHERIT" value="0" enum="EnableMode"> + </constant> + <constant name="ENABLE_MODE_ALWAYS" value="1" enum="EnableMode"> + </constant> + <constant name="ENABLE_MODE_WHEN_PAUSED" value="2" enum="EnableMode"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisibleOnScreenEnabler3D.xml b/doc/classes/VisibleOnScreenEnabler3D.xml new file mode 100644 index 0000000000..3205d6b415 --- /dev/null +++ b/doc/classes/VisibleOnScreenEnabler3D.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisibleOnScreenEnabler3D" inherits="VisibleOnScreenNotifier3D" version="4.0"> + <brief_description> + Enables certain nodes only when approximately visible. + </brief_description> + <description> + The VisibleOnScreenEnabler3D will disable [RigidBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibleOnScreenEnabler3D itself. + If you just want to receive notifications, use [VisibleOnScreenNotifier3D] instead. + [b]Note:[/b] VisibleOnScreenEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. + [b]Note:[/b] VisibleOnScreenEnabler3D will not affect nodes added after scene initialization. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibleOnScreenEnabler3D.EnableMode" default="0"> + </member> + <member name="enable_node_path" type="NodePath" setter="set_enable_node_path" getter="get_enable_node_path" default="NodePath("..")"> + </member> + </members> + <constants> + <constant name="ENABLE_MODE_INHERIT" value="0" enum="EnableMode"> + </constant> + <constant name="ENABLE_MODE_ALWAYS" value="1" enum="EnableMode"> + </constant> + <constant name="ENABLE_MODE_WHEN_PAUSED" value="2" enum="EnableMode"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisibleOnScreenNotifier2D.xml b/doc/classes/VisibleOnScreenNotifier2D.xml new file mode 100644 index 0000000000..f2f3bc9144 --- /dev/null +++ b/doc/classes/VisibleOnScreenNotifier2D.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisibleOnScreenNotifier2D" inherits="Node2D" version="4.0"> + <brief_description> + Detects when the node extents are visible on screen. + </brief_description> + <description> + The VisibleOnScreenNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. + If you want nodes to be disabled automatically when they exit the screen, use [VisibleOnScreenEnabler2D] instead. + </description> + <tutorials> + <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> + </tutorials> + <methods> + <method name="is_on_screen" qualifiers="const"> + <return type="bool"> + </return> + <description> + If [code]true[/code], the bounding rectangle is on the screen. + [b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. + </description> + </method> + </methods> + <members> + <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" default="Rect2( -10, -10, 20, 20 )"> + The VisibleOnScreenNotifier2D's bounding rectangle. + </member> + </members> + <signals> + <signal name="screen_entered"> + <description> + Emitted when the VisibleOnScreenNotifier2D enters the screen. + </description> + </signal> + <signal name="screen_exited"> + <description> + Emitted when the VisibleOnScreenNotifier2D exits the screen. + </description> + </signal> + </signals> + <constants> + </constants> +</class> diff --git a/doc/classes/VisibleOnScreenNotifier3D.xml b/doc/classes/VisibleOnScreenNotifier3D.xml new file mode 100644 index 0000000000..859dacd716 --- /dev/null +++ b/doc/classes/VisibleOnScreenNotifier3D.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisibleOnScreenNotifier3D" inherits="VisualInstance3D" version="4.0"> + <brief_description> + Detects approximately when the node is visible on screen. + </brief_description> + <description> + The VisibleOnScreenNotifier3D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera3D]'s view. + If you want nodes to be disabled automatically when they exit the screen, use [VisibleOnScreenEnabler3D] instead. + [b]Note:[/b] VisibleOnScreenNotifier3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="is_on_screen" qualifiers="const"> + <return type="bool"> + </return> + <description> + If [code]true[/code], the bounding box is on the screen. + [b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. + </description> + </method> + </methods> + <members> + <member name="aabb" type="AABB" setter="set_aabb" getter="get_aabb" default="AABB( -1, -1, -1, 2, 2, 2 )"> + The VisibleOnScreenNotifier3D's bounding box. + </member> + </members> + <signals> + <signal name="screen_entered"> + <description> + Emitted when the VisibleOnScreenNotifier3D enters the screen. + </description> + </signal> + <signal name="screen_exited"> + <description> + Emitted when the VisibleOnScreenNotifier3D exits the screen. + </description> + </signal> + </signals> + <constants> + </constants> +</class> diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot index d12fa78b0e..f138276364 100644 --- a/doc/translations/classes.pot +++ b/doc/translations/classes.pot @@ -20685,9 +20685,9 @@ msgid "" "onready var expression = Expression.new()\n" "\n" "func _ready():\n" -" $LineEdit.connect(\"text_entered\", self, \"_on_text_entered\")\n" +" $LineEdit.connect(\"text_submitted\", self, \"_on_text_submitted\")\n" "\n" -"func _on_text_entered(command):\n" +"func _on_text_submitted(command):\n" " var error = expression.parse(command, [])\n" " if error != OK:\n" " print(expression.get_error_text())\n" @@ -33187,7 +33187,7 @@ msgid "" "Examples:\n" "[codeblock]\n" "connect(\"pressed\", self, \"_on_Button_pressed\") # BaseButton signal\n" -"connect(\"text_entered\", self, \"_on_LineEdit_text_entered\") # LineEdit " +"connect(\"text_submitted\", self, \"_on_LineEdit_text_submitted\") # LineEdit " "signal\n" "connect(\"hit\", self, \"_on_Player_hit\", [ weapon_type, damage ]) # User-" "defined signal\n" |