Struct components::engine::d2::platform::BasicTexture
source · [−]pub struct BasicTexture<R> where
R: TextureRoot + Debug, {
pub inner: BasicAsset<BasicTexture<R>>,
pub graphics: Option<Rc<dyn Graphics + 'static>>,
pub root: R,
pub root_x: i32,
pub root_y: i32,
/* private fields */
}
Fields
inner: BasicAsset<BasicTexture<R>>
graphics: Option<Rc<dyn Graphics + 'static>>
root: R
root_x: i32
root_y: i32
Trait Implementations
sourceimpl<R> AsRef<BasicAsset<BasicTexture<R>>> for BasicTexture<R> where
R: TextureRoot + Debug,
impl<R> AsRef<BasicAsset<BasicTexture<R>>> for BasicTexture<R> where
R: TextureRoot + Debug,
sourcefn as_ref(&self) -> &BasicAsset<BasicTexture<R>>
fn as_ref(&self) -> &BasicAsset<BasicTexture<R>>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<R> Asset for BasicTexture<R> where
R: TextureRoot + Debug,
impl<R> Asset for BasicTexture<R> where
R: TextureRoot + Debug,
sourcefn reload_count(&self) -> usize
fn reload_count(&self) -> usize
The number of times this asset has been live-reloaded. Asset reloading is only enabled in debug builds, and only from the /assets directory. Read more
sourceimpl<R> Clone for BasicTexture<R> where
R: Clone + TextureRoot + Debug,
impl<R> Clone for BasicTexture<R> where
R: Clone + TextureRoot + Debug,
sourcefn clone(&self) -> BasicTexture<R>
fn clone(&self) -> BasicTexture<R>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<R> Debug for BasicTexture<R> where
R: Debug + TextureRoot,
impl<R> Debug for BasicTexture<R> where
R: Debug + TextureRoot,
sourceimpl<R> Default for BasicTexture<R> where
R: Default + TextureRoot + Debug,
impl<R> Default for BasicTexture<R> where
R: Default + TextureRoot + Debug,
sourcefn default() -> BasicTexture<R>
fn default() -> BasicTexture<R>
Returns the “default value” for a type. Read more
sourceimpl<R> Disposable for BasicTexture<R> where
R: TextureRoot + Debug,
impl<R> Disposable for BasicTexture<R> where
R: TextureRoot + Debug,
sourceimpl<R> SubTexture for BasicTexture<R> where
R: TextureRoot + Debug,
impl<R> SubTexture for BasicTexture<R> where
R: TextureRoot + Debug,
sourceimpl<R> Texture for BasicTexture<R> where
R: TextureRoot + Debug,
impl<R> Texture for BasicTexture<R> where
R: TextureRoot + Debug,
sourcefn graphics(&self) -> Box<dyn Graphics + 'static, Global>
fn graphics(&self) -> Box<dyn Graphics + 'static, Global>
The Graphics that draws to this texture. Read more
sourcefn read_pixels(&self, x: i32, y: i32, width: i32, height: i32) -> Bytes
fn read_pixels(&self, x: i32, y: i32, width: i32, height: i32) -> Bytes
Reads pixels out from the given region. This is potentially a very SLOW operation, avoid overusing it. Read more
sourcefn split(
&self,
tiles_wide: i32,
tiles_high: i32
) -> Vec<Rc<dyn SubTexture + 'static>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn split(
&self,
tiles_wide: i32,
tiles_high: i32
) -> Vec<Rc<dyn SubTexture + 'static>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Splits this texture into multiple tiles using sub_texture()
. Read more
sourcefn sub_texture(
&self,
x: i32,
y: i32,
width: i32,
height: i32
) -> Rc<dyn SubTexture + 'static>
fn sub_texture(
&self,
x: i32,
y: i32,
width: i32,
height: i32
) -> Rc<dyn SubTexture + 'static>
Creates a SubTexture that displays a region of this texture. Read more
Auto Trait Implementations
impl<R> !RefUnwindSafe for BasicTexture<R>
impl<R> !Send for BasicTexture<R>
impl<R> !Sync for BasicTexture<R>
impl<R> Unpin for BasicTexture<R> where
R: Unpin,
impl<R> !UnwindSafe for BasicTexture<R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.