logo
pub struct SubTexture {}

Implementations

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.

Retrieves the parent texture that self derives its content from. This is the texture that was passed to SubTexture::new as the parent_texture argument.

Returns

The parent texture that self derives its content from.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.