[go: up one dir, main page]

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 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]

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]

fn clone(&self) -> PointerState[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for PointerState[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for PointerState[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.