Skip to content

struct

Ease

pub struct Ease {
    pub curve: Curve,
    pub dir: Dir,
}

An easing function.

Fields

curve

pub curve: Curve

The curve's shape.

dir

pub dir: Dir

Which end eases.

Methods

LINEAR

pub const LINEAR: Ease;

No easing: progress follows time.

apply

pub fn apply(&self, t: f64) -> f64

Eased progress for t in 0..=1.

parse

pub fn parse(s: &str) -> Option<Ease>

Parse a GSAP ease string: "power3.out", "back.inOut(2)", "elastic.out(1, 0.4)", "steps(5)", "cubic-bezier(.17,.67,.83,.67)", "none". The direction defaults to out.

Trait implementations