Trait adi::Pulse [−][src]
pub trait Pulse { fn pulse_half_linear(&self, rate_spr: f32) -> f32; fn pulse_full_linear(&self, rate_spr: f32) -> f32; fn pulse_full_smooth(&self, rate_spr: f32) -> f32; fn pulse_half_smooth(&self, rate_spr: f32) -> f32; }
Call these functions on the return value of Clock::since(). Use rate_spr
to specify how many seconds it takes to cycle through the animation.
Required Methods
fn pulse_half_linear(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1.
fn pulse_full_linear(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1 and back to 0.
fn pulse_full_smooth(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1 and back to 0. It uses cosine underneath to make the animation look smooth, by making the beginning and end of the animation slower than the middle.
fn pulse_half_smooth(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1. It uses cosine underneath to make the animation look smooth, by making the beginning and end of the animation slower than the middle.
Implementations on Foreign Types
impl Pulse for f32
[src]
impl Pulse for f32
fn pulse_half_linear(&self, rate_spr: f32) -> f32
[src]
fn pulse_half_linear(&self, rate_spr: f32) -> f32
fn pulse_full_linear(&self, rate_spr: f32) -> f32
[src]
fn pulse_full_linear(&self, rate_spr: f32) -> f32
fn pulse_full_smooth(&self, rate_spr: f32) -> f32
[src]
fn pulse_full_smooth(&self, rate_spr: f32) -> f32
fn pulse_half_smooth(&self, rate_spr: f32) -> f32
[src]
fn pulse_half_smooth(&self, rate_spr: f32) -> f32