Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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.

Примітка

There are notable differences when using this API with C#. See Відмінності API C# в GDScript for more information.

Constructors

PackedInt32Array

PackedInt32Array ( )

PackedInt32Array

PackedInt32Array ( PackedInt32Array from )

PackedInt32Array

PackedInt32Array ( Array from )

Methods

bool

append ( int value )

void

append_array ( PackedInt32Array array )

int

bsearch ( int value, bool before=true )

void

clear ( )

int

count ( int value ) const

PackedInt32Array

duplicate ( )

void

fill ( int value )

int

find ( int value, int from=0 ) const

bool

has ( int value ) const

int

insert ( int at_index, int value )

bool

is_empty ( ) const

bool

push_back ( int value )

void

remove_at ( int index )

int

resize ( int new_size )

void

reverse ( )

int

rfind ( int value, int from=-1 ) const

void

set ( int index, int value )

int

size ( ) const

PackedInt32Array

slice ( int begin, int end=2147483647 ) const

void

sort ( )

PackedByteArray

to_byte_array ( ) const

Operators

bool

operator != ( PackedInt32Array right )

PackedInt32Array

operator + ( PackedInt32Array right )

bool

operator == ( PackedInt32Array right )

int

operator []<