pub struct Camera2D { /* private fields */ }Expand description
A 2D camera that defines the viewport into the game world.
Implementations§
Source§impl Camera2D
Implements camera transformation methods for Camera2D.
impl Camera2D
Implements camera transformation methods for Camera2D.
Sourcepub fn world_to_screen(&self, world: Vector2D) -> Vector2D
pub fn world_to_screen(&self, world: Vector2D) -> Vector2D
Sourcepub fn screen_to_world(&self, screen: Vector2D) -> Vector2D
pub fn screen_to_world(&self, screen: Vector2D) -> Vector2D
Source§impl Camera2D
impl Camera2D
pub fn get_position(&self) -> Vector2D
pub fn get_mut_position(&mut self) -> &mut Vector2D
pub fn set_position(&mut self, val: Vector2D) -> &mut Self
pub fn get_zoom(&self) -> f64
pub fn get_mut_zoom(&mut self) -> &mut f64
pub fn set_zoom(&mut self, val: f64) -> &mut Self
pub fn get_rotation(&self) -> f64
pub fn get_mut_rotation(&mut self) -> &mut f64
pub fn set_rotation(&mut self, val: f64) -> &mut Self
pub fn get_viewport_width(&self) -> f64
pub fn get_mut_viewport_width(&mut self) -> &mut f64
pub fn set_viewport_width(&mut self, val: f64) -> &mut Self
pub fn get_viewport_height(&self) -> f64
pub fn get_mut_viewport_height(&mut self) -> &mut f64
pub fn set_viewport_height(&mut self, val: f64) -> &mut Self
Trait Implementations§
impl Copy for Camera2D
Source§impl Default for Camera2D
Implements Default for Camera2D as a camera at the origin with 800x600 viewport.
impl Default for Camera2D
Implements Default for Camera2D as a camera at the origin with 800x600 viewport.
Source§impl PartialOrd for Camera2D
impl PartialOrd for Camera2D
impl StructuralPartialEq for Camera2D
Auto Trait Implementations§
impl Freeze for Camera2D
impl RefUnwindSafe for Camera2D
impl Send for Camera2D
impl Sync for Camera2D
impl Unpin for Camera2D
impl UnsafeUnpin for Camera2D
impl UnwindSafe for Camera2D
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