summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GlobalScope.xml10
-rw-r--r--doc/classes/AABB.xml16
-rw-r--r--doc/classes/AnimatedTexture.xml2
-rw-r--r--doc/classes/Camera2D.xml30
-rw-r--r--doc/classes/Dictionary.xml4
-rw-r--r--doc/classes/PopupMenu.xml4
-rw-r--r--doc/classes/Rect2.xml7
-rw-r--r--doc/classes/Rect2i.xml7
-rw-r--r--doc/classes/TileMap.xml20
9 files changed, 49 insertions, 51 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 10229bdb0e..5ec1b4051c 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -463,7 +463,7 @@
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, and [method range_lerp] to map a continuous series of values to another.
+ See also [method lerp] which performs the reverse of this operation, and [method remap] to map a continuous series of values to another.
</description>
</method>
<method name="is_equal_approx">
@@ -523,7 +523,7 @@
[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]. See also [method range_lerp] to map a continuous series of values to another.
+ 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]. See also [method remap] to map a continuous series of values to another.
[b]Note:[/b] For better type safety, you can use [method lerpf], [method Vector2.lerp], [method Vector3.lerp], [method Vector4.lerp], [method Color.lerp], [method Quaternion.slerp] or [method Basis.slerp] instead.
</description>
</method>
@@ -888,7 +888,7 @@
[b]Note:[/b] This method is called automatically when the project is run. If you need to fix the seed to have reproducible results, use [method seed] to initialize the random number generator.
</description>
</method>
- <method name="range_lerp">
+ <method name="remap">
<return type="float" />
<param index="0" name="value" type="float" />
<param index="1" name="istart" type="float" />
@@ -896,9 +896,9 @@
<param index="3" name="ostart" type="float" />
<param index="4" name="ostop" type="float" />
<description>
- Maps a [param value] from range [code][istart, istop][/code] to [code][ostart, ostop][/code]. See also [method lerp] and [method inverse_lerp]. If [param value] is outside [code][istart, istop][/code], then the resulting value will also be outside [code][ostart, ostop][/code]. Use [method clamp] on the result of [method range_lerp] if this is not desired.
+ Maps a [param value] from range [code][istart, istop][/code] to [code][ostart, ostop][/code]. See also [method lerp] and [method inverse_lerp]. If [param value] is outside [code][istart, istop][/code], then the resulting value will also be outside [code][ostart, ostop][/code]. Use [method clamp] on the result of [method remap] if this is not desired.
[codeblock]
- range_lerp(75, 0, 100, -1, 1) # Returns 0.5
+ remap(75, 0, 100, -1, 1) # Returns 0.5
[/codeblock]
For complex use cases where you need multiple ranges, consider using [Curve] or [Gradient] instead.
</description>
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index e2e4e7c61d..23dd41f275 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -142,24 +142,24 @@
Returns a copy of the [AABB] grown a given number of units towards all the sides.
</description>
</method>
- <method name="has_no_surface" qualifiers="const">
+ <method name="has_point" qualifiers="const">
<return type="bool" />
+ <param index="0" name="point" type="Vector3" />
<description>
- Returns [code]true[/code] if the [AABB] is empty.
+ Returns [code]true[/code] if the [AABB] contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks.
+ [b]Note:[/b] This method is not reliable for [AABB] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent [AABB] to check for contained points.
</description>
</method>
- <method name="has_no_volume" qualifiers="const">
+ <method name="has_surface" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the [AABB] is flat or empty.
+ Returns [code]true[/code] if the [AABB] has a surface or a length, and [code]false[/code] if the [AABB] is empty (all components of [member size] are zero or negative).
</description>
</method>
- <method name="has_point" qualifiers="const">
+ <method name="has_volume" qualifiers="const">
<return type="bool" />
- <param index="0" name="point" type="Vector3" />
<description>
- Returns [code]true[/code] if the [AABB] contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks.
- [b]Note:[/b] This method is not reliable for [AABB] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent [AABB] to check for contained points.
+ Returns [code]true[/code] if the [AABB] has a volume, and [code]false[/code] if the [AABB] is flat, empty, or has a negative [member size].
</description>
</method>
<method name="intersection" qualifiers="const">
diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml
index 5ad4c4e10a..d2fa7bb1e9 100644
--- a/doc/classes/AnimatedTexture.xml
+++ b/doc/classes/AnimatedTexture.xml
@@ -62,7 +62,7 @@
<member name="frames" type="int" setter="set_frames" getter="get_frames" default="1">
Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES].
</member>
- <member name="oneshot" type="bool" setter="set_oneshot" getter="get_oneshot" default="false">
+ <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [member pause] to [code]true[/code].
</member>
<member name="pause" type="bool" setter="set_pause" getter="get_pause" default="false">
diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml
index edb5235b75..bb78d537ad 100644
--- a/doc/classes/Camera2D.xml
+++ b/doc/classes/Camera2D.xml
@@ -7,7 +7,7 @@
Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem]-based nodes.
Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport.
This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from [Node2D] and change the transform of the canvas by setting [member Viewport.canvas_transform] in [Viewport] (you can obtain the current [Viewport] by using [method Node.get_viewport]).
- Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_camera_screen_center] to get the real position.
+ Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_screen_center_position] to get the real position.
</description>
<tutorials>
<link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
@@ -27,20 +27,6 @@
Forces the camera to update scroll immediately.
</description>
</method>
- <method name="get_camera_position" qualifiers="const">
- <return type="Vector2" />
- <description>
- 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">
<return type="float" />
<param index="0" name="margin" type="int" enum="Side" />
@@ -55,6 +41,20 @@
Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right].
</description>
</method>
+ <method name="get_screen_center_position" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the center of the screen from this camera's point of view, in global coordinates.
+ [b]Note:[/b] The exact targeted position of the camera may be different. See [method get_target_position].
+ </description>
+ </method>
+ <method name="get_target_position" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns this camera's target position, in global coordinates.
+ [b]Note:[/b] The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member smoothing_enabled] is [code]true[/code] (see [method get_screen_center_position]).
+ </description>
+ </method>
<method name="reset_smoothing">
<return type="void" />
<description>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 9dbeeb360c..a86aff060d 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -4,7 +4,7 @@
Dictionary type.
</brief_description>
<description>
- Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements. In other programming languages, this data structure is sometimes referred to as a hash map or associative array.
+ Dictionary type. Associative container, which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements. In other programming languages, this data structure is sometimes referred to as a hash map or associative array.
You can define a dictionary by placing a comma-separated list of [code]key: value[/code] pairs in curly braces [code]{}[/code].
Erasing elements while iterating over them [b]is not supported[/b] and will result in undefined behavior.
[b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate].
@@ -223,7 +223,7 @@
<param index="0" name="value" type="Variant" />
<description>
Returns the first key whose associated value is equal to [param value], or [code]null[/code] if no such value is found.
- [b]Node:[/b] [code]null[/code] is also a valid key. I you have it in your [Dictionary], the [method find_key] method can give misleading results.
+ [b]Note:[/b] [code]null[/code] is also a valid key. If you have it in your [Dictionary], the [method find_key] method can give misleading results.
</description>
</method>
<method name="get" qualifiers="const">
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index 00b725d5d7..23287f4de1 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -182,7 +182,7 @@
Removes all items from the [PopupMenu].
</description>
</method>
- <method name="get_current_index" qualifiers="const">
+ <method name="get_focused_item" qualifiers="const">
<return type="int" />
<description>
Returns the index of the currently focused item. Returns [code]-1[/code] if no item is focused.
@@ -332,7 +332,7 @@
Moves the scroll view to make the item at the given [param index] visible.
</description>
</method>
- <method name="set_current_index">
+ <method name="set_focused_item">
<return type="void" />
<param index="0" name="index" type="int" />
<description>
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index 7132f4f0b5..ac012e9604 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -93,7 +93,7 @@
<method name="get_area" qualifiers="const">
<return type="float" />
<description>
- Returns the area of the [Rect2]. See also [method has_no_area].
+ Returns the area of the [Rect2]. See also [method has_area].
</description>
</method>
<method name="get_center" qualifiers="const">
@@ -127,11 +127,10 @@
Returns a copy of the [Rect2] grown by the specified [param amount] on the specified [enum Side].
</description>
</method>
- <method name="has_no_area" qualifiers="const">
+ <method name="has_area" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the [Rect2] is flat or empty, [code]false[/code] otherwise. See also [method get_area].
- [b]Note:[/b] If the [Rect2] has a negative size and is not flat or empty, [method has_no_area] will return [code]true[/code].
+ Returns [code]true[/code] if the [Rect2] has area, and [code]false[/code] if the [Rect2] is linear, empty, or has a negative [member size]. See also [method get_area].
</description>
</method>
<method name="has_point" qualifiers="const">
diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml
index d5d68bde31..6d4c113609 100644
--- a/doc/classes/Rect2i.xml
+++ b/doc/classes/Rect2i.xml
@@ -90,7 +90,7 @@
<method name="get_area" qualifiers="const">
<return type="int" />
<description>
- Returns the area of the [Rect2i]. See also [method has_no_area].
+ Returns the area of the [Rect2i]. See also [method has_area].
</description>
</method>
<method name="get_center" qualifiers="const">
@@ -125,11 +125,10 @@
Returns a copy of the [Rect2i] grown by the specified [param amount] on the specified [enum Side].
</description>
</method>
- <method name="has_no_area" qualifiers="const">
+ <method name="has_area" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the [Rect2i] is flat or empty, [code]false[/code] otherwise. See also [method get_area].
- [b]Note:[/b] If the [Rect2i] has a negative size and is not flat or empty, [method has_no_area] will return [code]true[/code].
+ Returns [code]true[/code] if the [Rect2i] has area, and [code]false[/code] if the [Rect2i] is linear, empty, or has a negative [member size]. See also [method get_area].
</description>
</method>
<method name="has_point" qualifiers="const">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index e76c696021..54eb83297d 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -207,6 +207,13 @@
Returns if a layer Y-sorts its tiles.
</description>
</method>
+ <method name="local_to_map" qualifiers="const">
+ <return type="Vector2i" />
+ <param index="0" name="local_position" type="Vector2" />
+ <description>
+ Returns the map coordinates of the cell containing the given [param local_position]. If [param local_position] is in global coordinates, consider using [method Node2D.to_local] before passing it to this method. See also [method map_to_local].
+ </description>
+ </method>
<method name="map_pattern">
<return type="Vector2i" />
<param index="0" name="position_in_tilemap" type="Vector2i" />
@@ -216,12 +223,12 @@
Returns for the given coordinate [param coords_in_pattern] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [param position_in_tilemap] 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">
+ <method name="map_to_local" qualifiers="const">
<return type="Vector2" />
<param index="0" name="map_position" type="Vector2i" />
<description>
- Returns a local position of the center of the cell at the given tilemap (grid-based) coordinates.
- [b]Note:[/b] This doesn't correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_offset] property of individual tiles.
+ Returns the centered position of a cell in the TileMap's local coordinate space. To convert the returned value into global coordinates, use [method Node2D.to_global]. See also [method local_to_map].
+ [b]Note:[/b] This may not correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_offset] property of individual tiles.
</description>
</method>
<method name="move_layer">
@@ -344,13 +351,6 @@
Paste the given [TileMapPattern] at the given [param position] and [param layer] in the tile map.
</description>
</method>
- <method name="world_to_map" qualifiers="const">
- <return type="Vector2i" />
- <param index="0" name="world_position" type="Vector2" />
- <description>
- Returns the tilemap (grid-based) coordinates corresponding to the given local position.
- </description>
- </method>
</methods>
<members>
<member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" default="16">