summaryrefslogtreecommitdiffstats
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Array.xml6
-rw-r--r--doc/classes/PhysicsBody2D.xml2
-rw-r--r--doc/classes/PhysicsBody3D.xml2
3 files changed, 8 insertions, 2 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 40016f0904..fd5ba57615 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -218,6 +218,11 @@
<param index="1" name="before" type="bool" default="true" />
<description>
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
+ [codeblock]
+ var array = ["a", "b", "c", "c", "d", "e"]
+ print(array.bsearch("c", true)) # Prints 2, at the first matching element.
+ print(array.bsearch("c", false)) # Prints 4, after the last matching element, pointing to "d".
+ [/codeblock]
[b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
</description>
</method>
@@ -228,6 +233,7 @@
<param index="2" name="before" type="bool" default="true" />
<description>
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return [code]true[/code] if the first argument is less than the second, and return [code]false[/code] otherwise.
+ [b]Note:[/b] The custom method must accept the two arguments in any order, you cannot rely on that the first argument will always be from the array.
[b]Note:[/b] Calling [method bsearch_custom] on an unsorted array results in unexpected behavior.
</description>
</method>
diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml
index eef159d44d..fa3bb941bf 100644
--- a/doc/classes/PhysicsBody2D.xml
+++ b/doc/classes/PhysicsBody2D.xml
@@ -50,7 +50,7 @@
Removes a body from the list of bodies that this body can't collide with.
</description>
</method>
- <method name="test_move">
+ <method name="test_move" keywords="check, collision, sweep">
<return type="bool" />
<param index="0" name="from" type="Transform2D" />
<param index="1" name="motion" type="Vector2" />
diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml
index 866b3e298c..5019da35c8 100644
--- a/doc/classes/PhysicsBody3D.xml
+++ b/doc/classes/PhysicsBody3D.xml
@@ -68,7 +68,7 @@
Locks or unlocks the specified linear or rotational [param axis] depending on the value of [param lock].
</description>
</method>
- <method name="test_move">
+ <method name="test_move" keywords="check, collision, sweep">
<return type="bool" />
<param index="0" name="from" type="Transform3D" />
<param index="1" name="motion" type="Vector3" />