Struct notan_input::touch::Touch
source · pub struct Touch {
pub pressed: HashSet<u8>,
pub down: HashMap<u8, f32>,
pub released: HashSet<u8>,
/* private fields */
}Expand description
Represent the touches data
Fields§
§pressed: HashSet<u8>pressed touches
down: HashMap<u8, f32>down touches with delta time
released: HashSet<u8>released touches
Implementations§
source§impl Touch
impl Touch
sourcepub fn was_released(&self, id: u8) -> bool
pub fn was_released(&self, id: u8) -> bool
Returns true if the touch was released on the last frame
sourcepub fn was_pressed(&self, id: u8) -> bool
pub fn was_pressed(&self, id: u8) -> bool
Returns true if the touch was pressed on the last frame
sourcepub fn down_delta(&self, id: u8) -> f32
pub fn down_delta(&self, id: u8) -> f32
Returns the total time that the touch has been down
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Touch
impl RefUnwindSafe for Touch
impl Send for Touch
impl Sync for Touch
impl Unpin for Touch
impl UnwindSafe for Touch
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more