pub struct Viewport {
pub x: i32,
pub y: i32,
pub width: u32,
pub height: u32,
}
Expand description
Defines the part of the screen/render target that the camera is projecting into. All values should be in physical pixels.
Fields§
§x: i32
The distance in pixels from the left edge of the screen/render target.
y: i32
The distance in pixels from the bottom edge of the screen/render target.
width: u32
The width of the viewport.
height: u32
The height of the viewport.
Implementations§
Trait Implementations§
source§impl From<ScissorBox> for Viewport
impl From<ScissorBox> for Viewport
source§fn from(viewport: ScissorBox) -> Self
fn from(viewport: ScissorBox) -> Self
Converts to this type from the input type.
source§impl From<Viewport> for ScissorBox
impl From<Viewport> for ScissorBox
source§impl PartialEq for Viewport
impl PartialEq for Viewport
impl Copy for Viewport
impl StructuralPartialEq for Viewport
Auto Trait Implementations§
impl RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin for Viewport
impl UnwindSafe for Viewport
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