pub struct Vector2Array(/* private fields */);
Expand description
A reference-counted vector of Vector2
that uses Godot’s pool allocator.
Implementations§
Source§impl Vector2Array
impl Vector2Array
Sourcepub fn new() -> Vector2Array
pub fn new() -> Vector2Array
Creates an empty array.
Sourcepub fn from_variant_array(array: &VariantArray) -> Vector2Array
pub fn from_variant_array(array: &VariantArray) -> Vector2Array
Creates an array by trying to convert each variant
See Variant::to_vector2
.
Sourcepub fn push(&mut self, vector: &TypedVector2D<f32, UnknownUnit>)
pub fn push(&mut self, vector: &TypedVector2D<f32, UnknownUnit>)
Appends a vector to the end of the array.
Sourcepub fn push_array(&mut self, vectors: &Vector2Array)
pub fn push_array(&mut self, vectors: &Vector2Array)
Appends each vector to the end of the array.
Sourcepub fn insert(
&mut self,
offset: i32,
vector: &TypedVector2D<f32, UnknownUnit>,
) -> bool
pub fn insert( &mut self, offset: i32, vector: &TypedVector2D<f32, UnknownUnit>, ) -> bool
Inserts a vector at the given offset.
Sourcepub fn resize(&mut self, size: i32)
pub fn resize(&mut self, size: i32)
Changes the size of the array, possibly removing elements or pushing default values.
Sourcepub fn get(&self, idx: i32) -> TypedVector2D<f32, UnknownUnit>
pub fn get(&self, idx: i32) -> TypedVector2D<f32, UnknownUnit>
Returns a copy of the element at the given offset.
Sourcepub fn set(&mut self, idx: i32, vector: &TypedVector2D<f32, UnknownUnit>)
pub fn set(&mut self, idx: i32, vector: &TypedVector2D<f32, UnknownUnit>)
Sets the value of the element at the given offset.
pub fn new_ref(&self) -> Vector2Array
Trait Implementations§
Source§impl Default for Vector2Array
impl Default for Vector2Array
Source§fn default() -> Vector2Array
fn default() -> Vector2Array
Returns the “default value” for a type. Read more
Source§impl Drop for Vector2Array
impl Drop for Vector2Array
Source§impl<'l> From<&'l Vector2Array> for Variant
impl<'l> From<&'l Vector2Array> for Variant
Source§fn from(val: &'l Vector2Array) -> Variant
fn from(val: &'l Vector2Array) -> Variant
Converts to this type from the input type.
Source§impl ToVariant for Vector2Array
impl ToVariant for Vector2Array
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<Vector2Array>
Auto Trait Implementations§
impl Freeze for Vector2Array
impl RefUnwindSafe for Vector2Array
impl Send for Vector2Array
impl Sync for Vector2Array
impl Unpin for Vector2Array
impl UnwindSafe for Vector2Array
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more