Struct rbx_types::MaterialColors
source · pub struct MaterialColors { /* private fields */ }
Expand description
Represents the mapping of materials to colors used by Roblox’s Terrain
.
Implementations§
source§impl MaterialColors
impl MaterialColors
sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new MaterialColors
where all colors are their default
values.
sourcepub fn get_color(&self, material: TerrainMaterials) -> Color3uint8
pub fn get_color(&self, material: TerrainMaterials) -> Color3uint8
Retrieves the set color for the given material, or the default if none is set.
sourcepub fn set_color(&mut self, material: TerrainMaterials, color: Color3uint8)
pub fn set_color(&mut self, material: TerrainMaterials, color: Color3uint8)
Sets the color for the given material.
sourcepub fn encode(&self) -> Vec<u8>
pub fn encode(&self) -> Vec<u8>
Encodes the MaterialColors
into a binary blob that can be understood
by Roblox.
sourcepub fn decode(buffer: &[u8]) -> Result<Self, CrateError>
pub fn decode(buffer: &[u8]) -> Result<Self, CrateError>
Decodes a MaterialColors
from a binary blob. The blob must be
the same format used by encode
and Roblox.
Trait Implementations§
source§impl Clone for MaterialColors
impl Clone for MaterialColors
source§fn clone(&self) -> MaterialColors
fn clone(&self) -> MaterialColors
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MaterialColors
impl Debug for MaterialColors
source§impl Default for MaterialColors
impl Default for MaterialColors
source§fn default() -> MaterialColors
fn default() -> MaterialColors
Returns the “default value” for a type. Read more
source§impl From<MaterialColors> for Variant
impl From<MaterialColors> for Variant
source§fn from(value: MaterialColors) -> Self
fn from(value: MaterialColors) -> Self
Converts to this type from the input type.
source§impl<T> From<T> for MaterialColors
impl<T> From<T> for MaterialColors
source§impl PartialEq for MaterialColors
impl PartialEq for MaterialColors
source§fn eq(&self, other: &MaterialColors) -> bool
fn eq(&self, other: &MaterialColors) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for MaterialColors
Auto Trait Implementations§
impl RefUnwindSafe for MaterialColors
impl Send for MaterialColors
impl Sync for MaterialColors
impl Unpin for MaterialColors
impl UnwindSafe for MaterialColors
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