Struct immi::animations::Translation [] [src]

pub struct Translation {
    pub initial_offset: [f32; 2],
}

Relative movement of the element from initial_offset to [0.0, 0.0].

Fields

initial_offset: [f32; 2]

The initial position of the element at the start of the animation.

A value of 1.0 corresponds to half of the size of the element.

Methods

impl Translation
[src]

fn new(initial_offset: [f32; 2]) -> Translation

Builds a Translation object.

Trait Implementations

impl Animation for Translation
[src]

fn animate(&self, percent: f32) -> Matrix

Takes an animation percentage between 0.0 and 1.0. Returns the most-inner matrix to multiply the element with. Read more