PackedInt32Array¶
A packed array of 32-bit integers.
Description¶
An array specifically designed to hold 32-bit integer values. Packs data tightly, so it saves memory for large array sizes.
Note: This type stores signed 32-bit integers, which means it can take values in the interval [-2^31, 2^31 - 1]
, i.e. [-2147483648, 2147483647]
. Exceeding those bounds will wrap around. In comparison, int uses signed 64-bit integers which can hold much larger values. If you need to pack 64-bit integers tightly, see PackedInt64Array.
Note
There are notable differences when using this API with C#. See C# API differences to GDScript for more information.
Constructors¶
PackedInt32Array ( ) |
|
PackedInt32Array ( PackedInt32Array from ) |
|
PackedInt32Array ( Array from ) |
Methods¶
void |
append_array ( PackedInt32Array array ) |
void |
clear ( ) |
duplicate ( ) |
|
void |
|
is_empty ( ) const |
|
void |
|
void |
reverse ( ) |
void |
|
size ( ) const |
|
void |
sort ( ) |
to_byte_array ( ) const |
Operators¶
operator != ( PackedInt32Array right ) |
|
operator + ( PackedInt32Array right ) |
|
operator == ( PackedInt32Array right ) |
|
operator [] ( int index ) |
Constructor Descriptions¶
PackedInt32Array PackedInt32Array ( )
Constructs an empty PackedInt32Array.
PackedInt32Array PackedInt32Array ( PackedInt32Array from )
Constructs a PackedInt32Array as a copy of the given PackedInt32Array.
PackedInt32Array PackedInt32Array ( Array from )
Constructs a new PackedInt32Array. Optionally, you can pass in a generic Array that will be converted.