#[repr(transparent)]pub struct Texture2D(pub Object);Expand description
UnityEngine.Texture2D.
Tuple Fields§
§0: ObjectImplementations§
Source§impl Texture2D
impl Texture2D
pub const ASSEMBLY: &'static str = "UnityEngine.CoreModule"
pub const NAMESPACE: &'static str = "UnityEngine"
pub const NAME: &'static str = "Texture2D"
pub fn object(&self) -> Object
pub fn is_null(&self) -> bool
pub fn name(&self) -> Result<String>
pub fn set_name(&self, name: &str) -> Result<()>
Sourcepub fn dont_destroy_on_load(&self) -> Result<()>
pub fn dont_destroy_on_load(&self) -> Result<()>
Keeps the object when a new scene loads. Only works for GameObjects;
for assets (Material, Texture2D) use set_hide_flags.
Sourcepub fn set_hide_flags(&self, flags: HideFlags) -> Result<()>
pub fn set_hide_flags(&self, flags: HideFlags) -> Result<()>
Sets the object’s HideFlags. HideFlags::HIDE_AND_DONT_SAVE keeps a
runtime-created asset from being unloaded on scene load.
Source§impl Texture2D
impl Texture2D
Sourcepub fn new(width: i32, height: i32, format: TextureFormat) -> Result<Texture2D>
pub fn new(width: i32, height: i32, format: TextureFormat) -> Result<Texture2D>
new Texture2D(width, height, format, mipChain: false).
Sourcepub fn load_raw(&self, bytes: &[u8]) -> Result<()>
pub fn load_raw(&self, bytes: &[u8]) -> Result<()>
Uploads raw pixel bytes (matching the texture’s format), then applies them.
Sourcepub fn set_filter_mode(&self, mode: FilterMode) -> Result<()>
pub fn set_filter_mode(&self, mode: FilterMode) -> Result<()>
How the texture is sampled (Point avoids blending neighbouring texels).
Trait Implementations§
impl Copy for Texture2D
impl Eq for Texture2D
Source§impl Il2CppValue for Texture2D
impl Il2CppValue for Texture2D
impl StructuralPartialEq for Texture2D
Auto Trait Implementations§
impl Freeze for Texture2D
impl RefUnwindSafe for Texture2D
impl Send for Texture2D
impl Sync for Texture2D
impl Unpin for Texture2D
impl UnsafeUnpin for Texture2D
impl UnwindSafe for Texture2D
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