pub struct ScreenBox {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub screen_w: f32,
pub screen_h: f32,
}Expand description
Defines box on the screen starting at x,y width width and height Defeault to the whole screen. Staring at (0,0) with height going downwards With height of 1 being whole screen and width of 1 being whole screen
Fields§
§x: f32§y: f32§width: f32§height: f32§screen_w: f32§screen_h: f32Implementations§
Source§impl ScreenBox
impl ScreenBox
pub fn new( pixel_x: f32, pixel_y: f32, pixel_w: f32, pixel_h: f32, screen_w: f32, screen_h: f32, ) -> Self
pub fn full_screen(screen_w: f32, screen_h: f32) -> Self
pub fn left(&self) -> f32
pub fn right(&self) -> f32
pub fn top(&self) -> f32
pub fn bottom(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScreenBox
impl RefUnwindSafe for ScreenBox
impl Send for ScreenBox
impl Sync for ScreenBox
impl Unpin for ScreenBox
impl UnwindSafe for ScreenBox
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.