pub struct FrameEvents {
pub frame_count: u32,
/* private fields */
}Expand description
Frame events returned by GbaPeripherals::wait_frame()
Provides information about what happened during the frame.
§What’s Included
- Button presses: Buttons that transitioned from released to pressed
- Button releases: Buttons that transitioned from pressed to released
- Frame counter: Auto-incrementing counter for animations and timing
Fields§
§frame_count: u32Frame counter (wraps at u32::MAX)
Implementations§
Source§impl FrameEvents
impl FrameEvents
Sourcepub fn is_pressed(&self, button: Button) -> bool
pub fn is_pressed(&self, button: Button) -> bool
Check if a specific button was just pressed this frame
Sourcepub fn is_released(&self, button: Button) -> bool
pub fn is_released(&self, button: Button) -> bool
Check if a specific button was just released this frame
Sourcepub fn any_pressed(&self) -> bool
pub fn any_pressed(&self) -> bool
Check if any button was pressed this frame
Sourcepub fn any_released(&self) -> bool
pub fn any_released(&self) -> bool
Check if any button was released this frame
Get all buttons that were pressed this frame as a bitmask
Get all buttons that were released this frame as a bitmask
Trait Implementations§
Source§impl Clone for FrameEvents
impl Clone for FrameEvents
Source§fn clone(&self) -> FrameEvents
fn clone(&self) -> FrameEvents
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameEvents
impl Debug for FrameEvents
Source§impl Default for FrameEvents
impl Default for FrameEvents
Source§fn default() -> FrameEvents
fn default() -> FrameEvents
Returns the “default value” for a type. Read more
impl Copy for FrameEvents
Auto Trait Implementations§
impl Freeze for FrameEvents
impl RefUnwindSafe for FrameEvents
impl Send for FrameEvents
impl Sync for FrameEvents
impl Unpin for FrameEvents
impl UnwindSafe for FrameEvents
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)