diff options
author | Nonunknown <nonunknown777@gmail.com> | 2022-10-15 09:43:16 -0300 |
---|---|---|
committer | Nonunknown <nonunknown777@gmail.com> | 2022-10-20 08:39:47 -0300 |
commit | 9f4dbf415da6d150788915cb35a9c3dc7f04c547 (patch) | |
tree | 8168471787ca3bcb55371a67e4aa4d4efb444aca /doc | |
parent | dc4b6165962536b53c4c1471fcf0be43c70e2335 (diff) | |
download | redot-engine-9f4dbf415da6d150788915cb35a9c3dc7f04c547.tar.gz |
add ability to pick random value from array
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Array.xml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 047089c917..6e40ad0d8b 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -429,6 +429,16 @@ Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> + <method name="pick_random" qualifiers="const"> + <return type="Variant" /> + <description> + Returns a random value from the target array. + [codeblock] + var array: Array[int] = [1, 2, 3, 4] + print(array.pick_random()) # Prints either of the four numbers. + [/codeblock] + </description> + </method> <method name="pop_at"> <return type="Variant" /> <param index="0" name="position" type="int" /> |