pub struct Camera { /* private fields */ }Expand description
The anvil-game.camera service.
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn get(host: &Host) -> Option<Self>
pub fn get(host: &Host) -> Option<Self>
The service; None without anvil-game 1.25.0 or on a game build whose
camera symbols are declared absent.
Sourcepub fn c_api(&self) -> Table<AnvilGameCameraService>
pub fn c_api(&self) -> Table<AnvilGameCameraService>
The C table, for what this crate does not wrap.
Sourcepub fn pan(&self, right: f32, up: f32) -> Result<()>
pub fn pan(&self, right: f32, up: f32) -> Result<()>
Pans the map camera for this frame as the arrow keys do: right and
up from -1 to 1, a longer vector shortened to length 1, at the
arrows’ speed (the player’s scroll speed, the camera’s height and this
frame’s time). Call it once a frame while the input lasts; a second
call in the same frame pans twice. WrongPhase also while the camera
is locked, InvalidArgument for a value that is not finite; (0, 0)
does nothing.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Camera
impl Freeze for Camera
impl Move for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin for Camera
impl UnwindSafe for Camera
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