Struct gdnative_physics::common::ColorArray [−]
pub struct ColorArray(_);
A reference-counted vector of ColorArray
that uses Godot's pool allocator.
Methods
impl ColorArray
impl ColorArray
pub fn new() -> ColorArray
pub fn new() -> ColorArray
Creates an empty ColorArray
.
pub 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
.
pub fn push(&mut self, color: &Color)
pub fn push(&mut self, color: &Color)
Appends an element at the end of the array
pub fn push_array(&mut self, array: &ColorArray)
pub fn push_array(&mut self, array: &ColorArray)
Appends a ColorArray
at the end of this array.
pub 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.
pub fn invert(&mut self)
pub fn invert(&mut self)
Inverts the order of the elements in the array.
pub fn remove(&mut self, idx: i32)
pub fn remove(&mut self, idx: i32)
Removes an element at the given offset.
pub 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.
pub fn get(&self, idx: i32) -> Color
pub fn get(&self, idx: i32) -> Color
Returns a copy of the element at the given offset.
pub 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 len(&self) -> i32
pub fn len(&self) -> i32
Returns the number of elements in the array.
pub fn new_ref(&self) -> ColorArray
pub fn new_ref(&self) -> ColorArray
Trait Implementations
impl ToVariant for ColorArray
impl ToVariant for ColorArray
fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<ColorArray>
fn from_variant(variant: &Variant) -> Option<ColorArray>
impl<'l> From<&'l ColorArray> for Variant
impl<'l> From<&'l ColorArray> for Variant
fn from(val: &'l ColorArray) -> Variant
fn from(val: &'l ColorArray) -> Variant
Performs the conversion.
impl Default for ColorArray
impl Default for ColorArray
fn default() -> ColorArray
fn default() -> ColorArray
Returns the "default value" for a type. Read more
impl Drop for ColorArray
impl Drop for ColorArray
Auto Trait Implementations
impl Send for ColorArray
impl Send for ColorArray
impl Sync for ColorArray
impl Sync for ColorArray