pub struct MouseTracker {
pub x: u32,
pub y: u32,
pub screen_width: u32,
pub screen_height: u32,
pub learned_max_x: u32,
pub learned_max_y: u32,
}Expand description
画面サイズとマウス座標の厳格な管理を行うトラッカー
Fields§
§x: u32§y: u32§screen_width: u32§screen_height: u32§learned_max_x: u32§learned_max_y: u32Implementations§
Source§impl MouseTracker
impl MouseTracker
Sourcepub fn new(
initial_x: u32,
initial_y: u32,
screen_width: u32,
screen_height: u32,
) -> Self
pub fn new( initial_x: u32, initial_y: u32, screen_width: u32, screen_height: u32, ) -> Self
新しいトラッカーを初期化します
Sourcepub fn update_screen_size(&mut self, width: u32, height: u32)
pub fn update_screen_size(&mut self, width: u32, height: u32)
画面のリサイズなどで解像度が変更された場合に呼び出します
Sourcepub fn move_relative(&mut self, dx: i32, dy: i32)
pub fn move_relative(&mut self, dx: i32, dy: i32)
相対的な移動量 (dx, dy) を適用し、画面内にクランプします
Auto Trait Implementations§
impl Freeze for MouseTracker
impl RefUnwindSafe for MouseTracker
impl Send for MouseTracker
impl Sync for MouseTracker
impl Unpin for MouseTracker
impl UnsafeUnpin for MouseTracker
impl UnwindSafe for MouseTracker
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