Trait piston::UpdateEvent [−][src]
pub trait UpdateEvent {
pub fn from_update_args(args: &UpdateArgs, old_event: &Self) -> Option<Self>;
pub fn update<U, F>(&self, f: F) -> Option<U>
where
F: FnMut(&UpdateArgs) -> U;
pub fn from_dt(dt: f64, old_event: &Self) -> Option<Self> { ... }
pub fn update_args(&self) -> Option<UpdateArgs> { ... }
}When the application state should be updated.
Required methods
pub fn from_update_args(args: &UpdateArgs, old_event: &Self) -> Option<Self>[src]
Creates an update event.
pub fn update<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&UpdateArgs) -> U, [src]
F: FnMut(&UpdateArgs) -> U,
Calls closure if this is an update event.
Provided methods
pub fn from_dt(dt: f64, old_event: &Self) -> Option<Self>[src]
Creates an update event with delta time.
pub fn update_args(&self) -> Option<UpdateArgs>[src]
Returns update arguments.
Implementors
impl UpdateEvent for Event[src]
pub fn from_update_args(args: &UpdateArgs, _old_event: &Event) -> Option<Event>[src]
pub fn update<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&UpdateArgs) -> U, [src]
F: FnMut(&UpdateArgs) -> U,