[][src]Struct paddle::PointerTracker

pub struct PointerTracker { /* fields omitted */ }

Helper struct that can be added to a frame to track advanced cursor updates.

This can be useful to make the cursor position available to the draw function, for example to draw hover effects. Drag gestures are also supported, to perform e.g. scrolling.

Usage: Add it as a field to a frame and then call track_pointer_event() from the mouse method of the frame. Then read e.g. position from the field in any of the frame methods.

Implementations

impl PointerTracker[src]

pub fn new() -> Self[src]

pub fn pos(&self) -> Option<Vector>[src]

pub fn take_drag(&mut self) -> Option<(Vector, Vector)>[src]

Movement from point A to point B with touch or pressed mouse.

Reading a drag with this method clears the content. While moving the cursor, a partial drag are generated each frame. When multiple drags are generated before the user clear it, they are all summarized to one single movement.

pub fn track_pointer_event(&mut self, event: &PointerEvent)[src]

Trait Implementations

impl Clone for PointerTracker[src]

impl Copy for PointerTracker[src]

impl Debug for PointerTracker[src]

impl Default for PointerTracker[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Activity for T where
    T: Any
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,