Enum nannou::state::mouse::ButtonPosition [−][src]
pub enum ButtonPosition<S = DefaultScalar> { Up, Down(Point2<S>), }
Whether the button is up or down.
Variants
Up
The button is up (i.e. pressed).
Down(Point2<S>)
The button is down and was originally pressed down at the given Point2
.
Methods
impl<S> ButtonPosition<S> where
S: BaseFloat,
[src]
impl<S> ButtonPosition<S> where
S: BaseFloat,
pub fn relative_to(self, xy: Point2<S>) -> Self
[src]
pub fn relative_to(self, xy: Point2<S>) -> Self
If the mouse button is down, return a new one with position relative to the given xy
.
pub fn is_down(&self) -> bool
[src]
pub fn is_down(&self) -> bool
Is the ButtonPosition
down.
pub fn is_up(&self) -> bool
[src]
pub fn is_up(&self) -> bool
Is the ButtonPosition
up.
pub fn if_down(&self) -> Option<Point2<S>>
[src]
pub fn if_down(&self) -> Option<Point2<S>>
Returns the position at which the button was pressed.
Trait Implementations
impl<S: Copy> Copy for ButtonPosition<S>
[src]
impl<S: Copy> Copy for ButtonPosition<S>
impl<S: Clone> Clone for ButtonPosition<S>
[src]
impl<S: Clone> Clone for ButtonPosition<S>
fn clone(&self) -> ButtonPosition<S>
[src]
fn clone(&self) -> ButtonPosition<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for ButtonPosition<S>
[src]
impl<S: Debug> Debug for ButtonPosition<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PartialEq> PartialEq for ButtonPosition<S>
[src]
impl<S: PartialEq> PartialEq for ButtonPosition<S>
fn eq(&self, other: &ButtonPosition<S>) -> bool
[src]
fn eq(&self, other: &ButtonPosition<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ButtonPosition<S>) -> bool
[src]
fn ne(&self, other: &ButtonPosition<S>) -> bool
This method tests for !=
.
Auto Trait Implementations
impl<S> Send for ButtonPosition<S> where
S: Send,
impl<S> Send for ButtonPosition<S> where
S: Send,
impl<S> Sync for ButtonPosition<S> where
S: Sync,
impl<S> Sync for ButtonPosition<S> where
S: Sync,