pub struct Mouse {
pub x: u32,
pub y: u32,
pub is_clicked: bool,
pub click_frame: u8,
pub is_text_cursor: bool,
pub cursor_kind: CursorKind,
}Expand description
背景退避・描き戻し方式による動的マウスカーソル制御構造体
Fields§
§x: u32§y: u32§is_clicked: bool§click_frame: u8§is_text_cursor: boolCSS cursor: text 用フラグ(後方互換性用)
cursor_kind: CursorKind現在のカーソル形状種別
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 四方を前提に
保存/復元・ダーティ判定している)と矛盾しないようにする。
Sourcefn draw_pointer_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
fn draw_pointer_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
CSS cursor: pointer 用の指差し手形カーソルを手続き的に描画する。
Sourcefn draw_crosshair_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
fn draw_crosshair_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
CSS cursor: crosshair 用の十字線カーソルを手続き的に描画する。
Sourcefn draw_not_allowed_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
fn draw_not_allowed_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
CSS cursor: not-allowed 用の操作禁止カーソルを手続き的に描画する。
Sourcefn draw_grab_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
fn draw_grab_cursor(&self, screen: &Screen, draw_x: u32, draw_y: u32)
CSS cursor: grab 用の開いた手形カーソルを手続き的に描画する。
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