Merge pull request #62958 from Calinou/doc-packedarray-use-types

Document initializing PackedVectorArray/PackedColorArray correctly
This commit is contained in:
Rémi Verschelde 2023-06-15 10:39:28 +02:00
commit 48b282cfb0
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 12 additions and 0 deletions

View file

@ -27,6 +27,10 @@
<param index="0" name="from" type="Array" />
<description>
Constructs a new [PackedColorArray]. Optionally, you can pass in a generic [Array] that will be converted.
[b]Note:[/b] When initializing a [PackedColorArray] with elements, it must be initialized with an [Array] of [Color] values:
[codeblock]
var array = PackedColorArray([Color(0.1, 0.2, 0.3), Color(0.4, 0.5, 0.6)])
[/codeblock]
</description>
</constructor>
</constructors>

View file

@ -28,6 +28,10 @@
<param index="0" name="from" type="Array" />
<description>
Constructs a new [PackedVector2Array]. Optionally, you can pass in a generic [Array] that will be converted.
[b]Note:[/b] When initializing a [PackedVector2Array] with elements, it must be initialized with an [Array] of [Vector2] values:
[codeblock]
var array = PackedVector2Array([Vector2(12, 34), Vector2(56, 78)])
[/codeblock]
</description>
</constructor>
</constructors>

View file

@ -27,6 +27,10 @@
<param index="0" name="from" type="Array" />
<description>
Constructs a new [PackedVector3Array]. Optionally, you can pass in a generic [Array] that will be converted.
[b]Note:[/b] When initializing a [PackedVector3Array] with elements, it must be initialized with an [Array] of [Vector3] values:
[codeblock]
var array = PackedVector3Array([Vector3(12, 34, 56), Vector3(78, 90, 12)])
[/codeblock]
</description>
</constructor>
</constructors>