pub enum Move {
Static(usize, i32, Vec2),
Dynamic(usize, Easing, i32, i32, Vec2, Vec2),
}Expand description
Move event
Variants§
Trait Implementations§
Source§impl Into<Move> for (i32, Vec2)
Creates a static Move event with the timestamp and the position of the element
impl Into<Move> for (i32, Vec2)
Creates a static Move event with the timestamp and the position of the element
Uses a Linear easing
Example:
use osb::{utils::Vec2, Sprite};
let time = 0;
let pos = Vec2::from(320, 240);
let mut sprite = Sprite::new("res/sprite.png");
sprite.move_((time, pos));Source§impl<T, U> Into<Move> for (i32, T, U)
Creates a static Move event with the timestamp and the position of the element
impl<T, U> Into<Move> for (i32, T, U)
Creates a static Move event with the timestamp and the position of the element
Uses a Linear easing
Example:
use osb::Sprite;
let time = 0;
let x = 320;
let y = 240;
let mut sprite = Sprite::new("res/sprite.png");
sprite.move_((time, x, y));Source§impl Into<Move> for (i32, i32, Vec2, Vec2)
Creates a dynamic Move event with the timestamps and the positions of the element
impl Into<Move> for (i32, i32, Vec2, Vec2)
Creates a dynamic Move event with the timestamps and the positions of the element
Uses a Linear easing
Example:
use osb::{utils::Vec2, Sprite};
let start_time = 0;
let end_time = 1000;
let start_pos = Vec2::from(0, 0);
let end_pos = Vec2::from(320, 240);
let mut sprite = Sprite::new("res/sprite.png");
sprite.move_((start_time, end_time, start_pos, end_pos));Source§impl<T, U, V, W> Into<Move> for (i32, i32, T, U, V, W)
Creates a dynamic Move event with the timestamps and the positions of the element
impl<T, U, V, W> Into<Move> for (i32, i32, T, U, V, W)
Creates a dynamic Move event with the timestamps and the positions of the element
Uses a Linear easing
Example:
use osb::Sprite;
let start_time = 0;
let end_time = 1000;
let start_x = 0;
let start_y = 0;
let end_x = 320;
let end_y = 240;
let mut sprite = Sprite::new("res/sprite.png");
sprite.move_((start_time, end_time, start_x, start_y, end_x, end_y));Source§impl Into<Move> for (Easing, i32, i32, Vec2, Vec2)
Creates a dynamic Move event with the easing, the timestamps and the positions of the element
impl Into<Move> for (Easing, i32, i32, Vec2, Vec2)
Creates a dynamic Move event with the easing, the timestamps and the positions of the element
Example:
use osb::{utils::Vec2, Easing, Sprite};
let easing = Easing::Out;
let start_time = 0;
let end_time = 1000;
let start_pos = Vec2::from(0, 0);
let end_pos = Vec2::from(320, 240);
let mut sprite = Sprite::new("res/sprite.png");
sprite.move_((easing, start_time, end_time, start_pos, end_pos));Source§impl<T, U, V, W> Into<Move> for (Easing, i32, i32, T, U, V, W)
Creates a dynamic Move event with the timestamps and the positions of the element
impl<T, U, V, W> Into<Move> for (Easing, i32, i32, T, U, V, W)
Creates a dynamic Move event with the timestamps and the positions of the element
Example:
use osb::{Easing, Sprite};
let easing = Easing::Out;
let start_time = 0;
let end_time = 1000;
let start_x = 0;
let start_y = 0;
let end_x = 320;
let end_y = 240;
let mut sprite = Sprite::new("res/sprite.png");
sprite.move_((easing, start_time, end_time, start_x, start_y, end_x, end_y));Auto Trait Implementations§
impl Freeze for Move
impl RefUnwindSafe for Move
impl Send for Move
impl Sync for Move
impl Unpin for Move
impl UnsafeUnpin for Move
impl UnwindSafe for Move
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