pub struct SubTexture {}
Implementations
sourceimpl SubTexture
impl SubTexture
sourcepub fn new<P: Is<Texture>>(
ctx: &Context,
parent_texture: &P,
sub_x: i32,
sub_y: i32,
sub_width: i32,
sub_height: i32
) -> SubTexture
pub fn new<P: Is<Texture>>(
ctx: &Context,
parent_texture: &P,
sub_x: i32,
sub_y: i32,
sub_width: i32,
sub_height: i32
) -> SubTexture
Creates a high-level SubTexture
representing a sub-region of
any other Texture
. The sub-region must strictly lye within the
bounds of the parent_texture
. The returned texture implements the
MetaTexture
interface because it’s not a low level texture
that hardware can understand natively.
Remember: Unless you are using high level drawing APIs such
as rectangle
or other APIs documented to understand the
MetaTexture
interface then you need to use the
MetaTexture
interface to resolve a SubTexture
into a
low-level texture before drawing.
ctx
A Context
pointer
parent_texture
The full texture containing a sub-region you want
to make a SubTexture
from.
sub_x
The top-left x coordinate of the parent region to make a texture from.
sub_y
The top-left y coordinate of the parent region to make a texture from.
sub_width
The width of the parent region to make a texture from.
sub_height
The height of the parent region to make a texture from.
Returns
A newly allocated SubTexture
representing a sub-region of parent_texture
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SubTexture
impl Send for SubTexture
impl Sync for SubTexture
impl Unpin for SubTexture
impl UnwindSafe for SubTexture
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
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn 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
.