Struct egui::PointerState[][src]

pub struct PointerState { /* fields omitted */ }

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]

pub fn ui(&self, ui: &mut Ui)[src]

Trait Implementations

impl Clone for PointerState[src]

impl Debug for PointerState[src]

impl Default for PointerState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.