Struct tinybit::camera::Camera [−][src]
Camera
Fields
position: WorldPos
Global position
Implementations
impl<T> Camera<T>
[src]
pub fn resize(&mut self, width: u16, height: u16)
[src]
Resize the camera
pub fn to_screen(&self, pos: WorldPos) -> ScreenPos
[src]
Convert a point to local space.
pub fn move_to(&mut self, new_pos: WorldPos)
[src]
Move the camera to a new position in global space
impl Camera<NoLimit>
[src]
pub fn from_viewport(position: WorldPos, viewport: &Viewport) -> Camera<NoLimit>
[src]
Create a new camera at a specific world position, with a fixed size.
pub fn new(position: WorldPos, size: WorldSize) -> Camera<NoLimit>
[src]
Create a new camera
pub fn with_limit(
self,
top: u16,
right: u16,
bottom: u16,
left: u16
) -> Camera<Limit>
[src]
self,
top: u16,
right: u16,
bottom: u16,
left: u16
) -> Camera<Limit>
The limit is used for tracking. For more information see tracking
.
given a limit of 1, 1, 1, 1, c
represents the centre:
[ ] [ ] [ ] [ ] [ ]
[ ] [x] [x] [x] [ ]
[ ] [x] [c] [x] [ ]
[ ] [x] [x] [x] [ ]
[ ] [ ] [ ] [ ] [ ]
impl Camera<Limit>
[src]
pub fn track(&mut self, pos: WorldPos)
[src]
Move the camera if the target is outside of the camera’s limit
box
Auto Trait Implementations
impl<T> RefUnwindSafe for Camera<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Camera<T> where
T: Send,
T: Send,
impl<T> Sync for Camera<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Camera<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Camera<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,