Skip to main content

Fade

Enum Fade 

Source
pub enum Fade {
    Static(usize, i32, Number),
    Dynamic(usize, Easing, i32, i32, Number, Number),
}
Expand description

Fade event

Variants§

Trait Implementations§

Source§

impl Event for Fade

Source§

fn to_line(&self) -> String

Source§

fn set_depth(&mut self, depth: usize)

Source§

fn get_start_time(&self) -> i32

Source§

fn get_end_time(&self) -> i32

Source§

impl<T> Into<Fade> for (i32, T)
where T: Into<Number>,

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§

fn into(self) -> Fade

Converts this type into the (usually inferred) input type.
Source§

impl<T, U> Into<Fade> for (i32, i32, T, U)
where T: Into<Number>, U: Into<Number>,

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§

fn into(self) -> Fade

Converts this type into the (usually inferred) input type.
Source§

impl<T, U> Into<Fade> for (Easing, i32, i32, T, U)
where T: Into<Number>, U: Into<Number>,

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));
Source§

fn into(self) -> Fade

Converts this type into the (usually inferred) input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.