Movable

Trait Movable 

Source
pub trait Movable {
    // Required methods
    fn translate<T>(&mut self, offset: Vector<T>)
       where T: Scalar + Into<f32>;
    fn set_position<T>(&mut self, pos: Vector<T>)
       where T: Scalar + Into<f32>;
    fn get_position(&self) -> Vector<f32>;
}
Expand description

Trait defining movable structures as sprite or higher

Required Methods§

Source

fn translate<T>(&mut self, offset: Vector<T>)
where T: Scalar + Into<f32>,

Move the sprite off the offset

Source

fn set_position<T>(&mut self, pos: Vector<T>)
where T: Scalar + Into<f32>,

Set position of the sprite

Source

fn get_position(&self) -> Vector<f32>

Get current position

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§