Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PackedVector2Array

A packed array of Vector2s.

Description

An array specifically designed to hold Vector2. Packs data tightly, so it saves memory for large array sizes.

Note

There are notable differences when using this API with C#. See C# API differences to GDScript for more information.

Tutorials

Constructors

PackedVector2Array

PackedVector2Array()

PackedVector2Array

PackedVector2Array(from: PackedVector2Array)

PackedVector2Array

PackedVector2Array(from: Array)

Methods

bool

append(value: Vector2)

void

append_array(array: PackedVector2Array)

int

bsearch(value: Vector2, before: bool = true)

void

clear()

int

count(value: Vector2) const

PackedVector2Array

duplicate()

void

fill(value: Vector2)

int

find(value: Vector2, from: int = 0) const

bool

has(value: Vector2) const

int

insert(at_index: int, value: Vector2)

bool

is_empty() const

bool

push_back(value: Vector2)

void

remove_at(index: int)

int

resize(new_size: int)

void

reverse()

int

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

void

set(index: int, value: Vector2)

int

size() const

PackedVector2Array

slice(begin: int, end: int = 2147483647) const

void

sort()

PackedByteArray

to_byte_array() const

Operators

bool

operator !=(right: PackedVector2Array)

PackedVector2Array

operator *(right: Transform2D)

PackedVector2Array

operator +(right: PackedVector2Array)

bool

operator ==(right: PackedVector2Array)

Vector2

operator [](index: int)


Constructor Descriptions

PackedVector2Array PackedVector2Array()

Constructs an empty PackedVector2Array.


PackedVector2Array PackedVector2Array(from: PackedVector2Arra