[−][src]Struct paddle::PointerTracker
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]
pub fn clone(&self) -> PointerTracker
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PointerTracker
[src]
impl Debug for PointerTracker
[src]
impl Default for PointerTracker
[src]
pub fn default() -> PointerTracker
[src]
Auto Trait Implementations
impl RefUnwindSafe for PointerTracker
[src]
impl Send for PointerTracker
[src]
impl Sync for PointerTracker
[src]
impl Unpin for PointerTracker
[src]
impl UnwindSafe for PointerTracker
[src]
Blanket Implementations
impl<T> Activity for T where
T: Any,
[src]
T: Any,
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>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,