summaryrefslogtreecommitdiff
path: root/doc/classes/Array.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Array.xml')
-rw-r--r--doc/classes/Array.xml21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 54bbe7a94b..38b74cb436 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -237,6 +237,27 @@
[b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
</description>
</method>
+ <method name="fill">
+ <return type="void">
+ </return>
+ <argument index="0" name="value" type="Variant">
+ </argument>
+ <description>
+ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements:
+ [codeblocks]
+ [gdscript]
+ var array = []
+ array.resize(10)
+ array.fill(0) # Initialize the 10 elements to 0.
+ [/gdscript]
+ [csharp]
+ var array = new Godot.Collections.Array{};
+ array.Resize(10);
+ array.Fill(0); // Initialize the 10 elements to 0.
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
<method name="find" qualifiers="const">
<return type="int">
</return>