pub struct Cursor {
pub pos: Pos,
pub blink_t: f32,
}Expand description
The cursor: a map tile and the time into its pulse.
Fields§
§pos: PosThe tile under the cursor; always on the map.
blink_t: f32Seconds into the current pulse, in 0..BLINK_PERIOD.
Implementations§
Source§impl Cursor
impl Cursor
Sourcepub fn tick(&mut self, dt: f32)
pub fn tick(&mut self, dt: f32)
Advances the pulse by dt seconds (negative or non-finite dt
counts as zero).
Sourcepub fn brightness(&self) -> f32
pub fn brightness(&self) -> f32
Current brightness: 1 at the start of a pulse, down to
BLINK_MIN halfway through, then back up (a cosine).
Trait Implementations§
impl Copy for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnsafeUnpin for Cursor
impl UnwindSafe for Cursor
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