pub struct Mouse {
pub x: u32,
pub y: u32,
pub is_clicked: bool,
pub click_frame: u8,
pub is_text_cursor: bool,
}Expand description
背景退避・描き戻し方式による動的マウスカーソル制御構造体
Fields§
§x: u32§y: u32§is_clicked: bool§click_frame: u8§is_text_cursor: boolCSS cursor: text 用。矢印の代わりに I-beam(縦棒)を手続き的に描く。
それ以外の非対応 cursor キーワード(pointer/wait/help 等)は既定の矢印にフォールバックする。
Implementations§
Source§impl Mouse
impl Mouse
pub const SIZE: u32 = 32
pub const fn new(x: u32, y: u32) -> Self
pub fn draw(&self, screen: &Screen)
Sourcefn draw_text_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
fn draw_text_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
CSS cursor: text 用の I-beam カーソルを手続き的に描画する。
新規 SVG アイコン資産を追加せず、draw_pixel の直描きだけで完結させる
(矢印(SVGラスタライズ)と異なり、コード自体の正しさだけで見た目を保証できる形状)。
Self::SIZE 四方のバウンディングボックス内に収め、既存のダーティ領域管理
(flush_with_cursor/flush_dirty_pageflip が Self::SIZE 四方を前提に
保存/復元・ダーティ判定している)と矛盾しないようにする。
Auto Trait Implementations§
impl Freeze for Mouse
impl RefUnwindSafe for Mouse
impl Send for Mouse
impl Sync for Mouse
impl Unpin for Mouse
impl UnsafeUnpin for Mouse
impl UnwindSafe for Mouse
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