Struct egui::PointerState [−][src]
pub struct PointerState { /* fields omitted */ }Mouse or touch state.
Implementations
impl PointerState[src]
impl PointerState[src]pub fn press_origin(&self) -> Option<Pos2>[src]
pub fn press_origin(&self) -> Option<Pos2>[src]Where did the current click/drag originate?
None if no mouse button is down.
pub fn hover_pos(&self) -> Option<Pos2>[src]
pub fn hover_pos(&self) -> Option<Pos2>[src]If it is a good idea to show a tooltip, where is pointer?
pub fn interact_pos(&self) -> Option<Pos2>[src]
pub fn interact_pos(&self) -> Option<Pos2>[src]If you detect a click or drag and wants to know where it happened, use this.
Latest position of the mouse, but ignoring any Event::PointerGone
if there were interactions this frame.
When tapping a touch screen, this will be the location of the touch.
pub fn has_pointer(&self) -> bool[src]
pub fn has_pointer(&self) -> bool[src]Do we have a pointer?
false if the mouse is not over the egui area, or if no touches are down on touch screens.
pub fn is_still(&self) -> bool[src]
pub fn is_still(&self) -> bool[src]Is the pointer currently still?
This is smoothed so a few frames of stillness is required before this returns true.
pub fn is_moving(&self) -> bool[src]
pub fn is_moving(&self) -> bool[src]Is the pointer currently moving?
This is smoothed so a few frames of stillness is required before this returns false.
pub fn any_pressed(&self) -> bool[src]
pub fn any_pressed(&self) -> bool[src]Was any pointer button pressed (!down -> down) this frame?
This can sometimes return true even if any_down() == false
because a press can be shorted than one frame.
pub fn any_released(&self) -> bool[src]
pub fn any_released(&self) -> bool[src]Was any pointer button released (down -> !down) this frame?
pub fn button_down(&self, button: PointerButton) -> bool[src]
pub fn button_down(&self, button: PointerButton) -> bool[src]Is this button currently down?
impl PointerState[src]
impl PointerState[src]Trait Implementations
impl Clone for PointerState[src]
impl Clone for PointerState[src]fn clone(&self) -> PointerState[src]
fn clone(&self) -> PointerState[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for PointerState[src]
impl Debug for PointerState[src]Auto Trait Implementations
impl RefUnwindSafe for PointerState
impl Send for PointerState
impl Sync for PointerState
impl Unpin for PointerState
impl UnwindSafe for PointerState
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more