1 2 3 4 5 6 7 8 9 10 11 12 13
use super::Texture;
/// A sub-region of a texture atlas, created by `Texture.subTexture`.
pub trait SubTexture: Texture {
/// The original texture that this sub-texture is a part of.
fn parent(&self) -> Option<Box<dyn Texture>>;
/// The X offset into the parent texture, in pixels.
fn x(&self) -> i32;
/// The Y offset into the parent texture, in pixels.
fn y(&self) -> i32;
}