[][src]Struct macroquad::Camera2D

pub struct Camera2D {
    pub rotation: f32,
    pub zoom: Vec2,
    pub target: Vec2,
    pub offset: Vec2,
}

Fields

rotation: f32

Rotation in degrees

zoom: Vec2

Scaling, should be (1.0, 1.0) by default

target: Vec2

Rotation and zoom origin

offset: Vec2

Displacement from target

Implementations

impl Camera2D[src]

pub fn world_to_screen(&self, point: Vec2) -> Vec2[src]

Returns the screen space position for a 2d camera world space position

pub fn screen_to_world(&self, point: Vec2) -> Vec2[src]

Trait Implementations

impl Camera for Camera2D[src]

impl Clone for Camera2D[src]

impl Copy for Camera2D[src]

impl Default for Camera2D[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.