pub struct TileTextureRegion {
pub u_min: f32,
pub v_min: f32,
pub u_max: f32,
pub v_max: f32,
}Expand description
Normalized texture-space region within an actual tile image that maps to
a target tile.
Fields§
§u_min: f32Minimum U in normalized texture coordinates.
v_min: f32Minimum V in normalized texture coordinates.
u_max: f32Maximum U in normalized texture coordinates.
v_max: f32Maximum V in normalized texture coordinates.
Implementations§
Source§impl TileTextureRegion
impl TileTextureRegion
Sourcepub fn from_tiles(target: &TileId, actual: &TileId) -> Self
pub fn from_tiles(target: &TileId, actual: &TileId) -> Self
Compute the normalized texture-space region of actual needed to draw
target.
Sourcepub fn from_child_tile(target: &TileId, child: &TileId) -> Option<Self>
pub fn from_child_tile(target: &TileId, child: &TileId) -> Option<Self>
Compute the texture region for rendering a child tile (at a higher zoom) into the grid cell of a target tile (at a lower zoom).
This is the inverse of from_tiles which
handles the parent-fallback (overzoom) case. For child-fallback
(underzoom), the child’s full texture maps into a sub-region of the
target’s grid cell.
§Returns
None if child is not a descendant of target.
Trait Implementations§
Source§impl Clone for TileTextureRegion
impl Clone for TileTextureRegion
Source§fn clone(&self) -> TileTextureRegion
fn clone(&self) -> TileTextureRegion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TileTextureRegion
impl Debug for TileTextureRegion
Source§impl PartialEq for TileTextureRegion
impl PartialEq for TileTextureRegion
impl Copy for TileTextureRegion
impl StructuralPartialEq for TileTextureRegion
Auto Trait Implementations§
impl Freeze for TileTextureRegion
impl RefUnwindSafe for TileTextureRegion
impl Send for TileTextureRegion
impl Sync for TileTextureRegion
impl Unpin for TileTextureRegion
impl UnsafeUnpin for TileTextureRegion
impl UnwindSafe for TileTextureRegion
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