[][src]Struct bevy::prelude::Timer

pub struct Timer {
    pub elapsed: f32,
    pub duration: f32,
    pub finished: bool,
    pub just_finished: bool,
    pub repeating: bool,
}

Tracks elapsed time. Enters the finished state once duration is reached.

Non repeating timers will stop tracking and stay in the finished state until reset. Repeating timers will only be in the finished state on each tick duration is reached or exceeded, and can still be reset at any given point.

Fields

elapsed: f32duration: f32finished: booljust_finished: bool

Will only be true on the tick duration is reached or exceeded.

repeating: bool

Implementations

impl Timer[src]

pub fn new(duration: Duration, repeating: bool) -> Timer[src]

pub fn from_seconds(seconds: f32, repeating: bool) -> Timer[src]

pub fn tick(&mut self, delta: f32)[src]

Advances the timer by delta seconds.

pub fn reset(&mut self)[src]

Trait Implementations

impl Clone for Timer[src]

impl Debug for Timer[src]

impl Default for Timer[src]

impl DeserializeProperty for Timer[src]

impl Properties for Timer[src]

impl Property for Timer[src]

Auto Trait Implementations

impl RefUnwindSafe for Timer

impl Send for Timer

impl Sync for Timer

impl Unpin for Timer

impl UnwindSafe for Timer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> FromResources for T where
    T: Default
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<P> PropertiesVal for P where
    P: Properties
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,