Struct egui::PointerState [−][src]
Mouse or touch state.
Implementations
impl PointerState
[src]
pub fn delta(&self) -> Vec2
[src]
How much the pointer moved compared to last frame, in points.
pub fn velocity(&self) -> Vec2
[src]
Current velocity of pointer.
pub fn press_origin(&self) -> Option<Pos2>
[src]
Where did the current click/drag originate?
None
if no mouse button is down.
pub fn tooltip_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]
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]
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]
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]
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]
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]
Was any pointer button released (down -> !down
) this frame?
pub fn any_down(&self) -> bool
[src]
Is any pointer button currently down?
pub fn any_click(&self) -> bool
[src]
Were there any type of click this frame?
pub fn button_down(&self, button: PointerButton) -> bool
[src]
Is this button currently down?
impl PointerState
[src]
Trait Implementations
impl Clone for PointerState
[src]
fn clone(&self) -> PointerState
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PointerState
[src]
impl Default 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,