pub struct ColorArray(/* private fields */);
Expand description
A reference-counted vector of ColorArray
that uses Godot’s pool allocator.
Implementations§
Source§impl ColorArray
impl ColorArray
Sourcepub fn new() -> ColorArray
pub fn new() -> ColorArray
Creates an empty ColorArray
.
Sourcepub fn from_variant_array(array: &VariantArray) -> ColorArray
pub fn from_variant_array(array: &VariantArray) -> ColorArray
Creates an array by trying to convert each variant.
See Variant::to_color_array
.
Sourcepub fn push_array(&mut self, array: &ColorArray)
pub fn push_array(&mut self, array: &ColorArray)
Appends a ColorArray
at the end of this array.
Sourcepub fn insert(&mut self, offset: i32, color: &Color) -> bool
pub fn insert(&mut self, offset: i32, color: &Color) -> bool
Insert a new int at a given position in the array.
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 set(&mut self, idx: i32, color: &Color)
pub fn set(&mut self, idx: i32, color: &Color)
Sets the value of the element at the given offset.
pub fn new_ref(&self) -> ColorArray
Trait Implementations§
Source§impl Default for ColorArray
impl Default for ColorArray
Source§fn default() -> ColorArray
fn default() -> ColorArray
Returns the “default value” for a type. Read more
Source§impl Drop for ColorArray
impl Drop for ColorArray
Source§impl<'l> From<&'l ColorArray> for Variant
impl<'l> From<&'l ColorArray> for Variant
Source§fn from(val: &'l ColorArray) -> Variant
fn from(val: &'l ColorArray) -> Variant
Converts to this type from the input type.
Source§impl ToVariant for ColorArray
impl ToVariant for ColorArray
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<ColorArray>
Auto Trait Implementations§
impl Freeze for ColorArray
impl RefUnwindSafe for ColorArray
impl Send for ColorArray
impl Sync for ColorArray
impl Unpin for ColorArray
impl UnwindSafe for ColorArray
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