pub enum Fade {
Static(usize, i32, Number),
Dynamic(usize, Easing, i32, i32, Number, Number),
}Expand description
Fade event
Variants§
Trait Implementations§
Source§impl<T> Into<Fade> for (i32, T)
Creates a static Fade event with the timestamp and the opacity of the element
impl<T> Into<Fade> for (i32, T)
Creates a static Fade event with the timestamp and the opacity of the element
Uses a Linear easing
Example:
use osb::Sprite;
let time = 0;
let opacity = 1;
let mut sprite = Sprite::new("res/sprite.png");
sprite.fade_((time, opacity));Source§impl<T, U> Into<Fade> for (i32, i32, T, U)
Creates a dynamic Fade event with the timestamps and the opacity of the element
impl<T, U> Into<Fade> for (i32, i32, T, U)
Creates a dynamic Fade event with the timestamps and the opacity of the element
Uses a Linear easing
Example:
use osb::Sprite;
let start_time = 0;
let end_time = 1000;
let start_opacity = 0;
let end_opacity = 1;
let mut sprite = Sprite::new("res/sprite.png");
sprite.fade_((start_time, end_time, start_opacity, end_opacity));Source§impl<T, U> Into<Fade> for (Easing, i32, i32, T, U)
Creates a dynamic Fade event with the easing, the timestamps and the opacity of the element
impl<T, U> Into<Fade> for (Easing, i32, i32, T, U)
Creates a dynamic Fade event with the easing, the timestamps and the opacity of the element
Example:
use osb::{Easing, Sprite};
let easing = Easing::Out;
let start_time = 0;
let end_time = 1000;
let start_opacity = 0;
let end_opacity = 1;
let mut sprite = Sprite::new("res/sprite.png");
sprite.fade_((easing, start_time, end_time, start_opacity, end_opacity));Auto Trait Implementations§
impl Freeze for Fade
impl RefUnwindSafe for Fade
impl Send for Fade
impl Sync for Fade
impl Unpin for Fade
impl UnsafeUnpin for Fade
impl UnwindSafe for Fade
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