pub struct Camera2D { /* private fields */ }Expand description
A struct for 2D camera object in the game engine.
Implementations§
Source§impl Camera2D
impl Camera2D
Sourcepub fn set_rotation(&mut self, val: f32)
pub fn set_rotation(&mut self, val: f32)
Sets the rotation angle of the camera in degrees.
Sourcepub fn get_rotation(&self) -> f32
pub fn get_rotation(&self) -> f32
Gets the rotation angle of the camera in degrees.
Sourcepub fn set_zoom(&mut self, val: f32)
pub fn set_zoom(&mut self, val: f32)
Sets the factor by which to zoom the camera. If set to 1.0, the view is normal sized. If set to 2.0, items will appear double in size.
Sourcepub fn get_zoom(&self) -> f32
pub fn get_zoom(&self) -> f32
Gets the factor by which to zoom the camera. If set to 1.0, the view is normal sized. If set to 2.0, items will appear double in size.
Sourcepub fn set_position(&mut self, val: &Vec2)
pub fn set_position(&mut self, val: &Vec2)
Sets the position of the camera in the game world.
Sourcepub fn get_position(&self) -> Vec2
pub fn get_position(&self) -> Vec2
Gets the position of the camera in the game world.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Camera2D
impl RefUnwindSafe for Camera2D
impl Send for Camera2D
impl Sync for Camera2D
impl Unpin 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