📄
eaz
  • eaz
  • Easing
    • Generational Static Methods
    • Predefined Easing Objects
  • DemoImage
Powered by GitBook
On this page
  • in(easing: Easing, outPath: string, steps: number = 200)
  • out(easing: Easing, outPath: string, steps: number = 200)
  • inOut(easing: Easing, outPath: string, steps: number = 200)
  • interpolate(inEasing: Easing, outEasing: Easing, outPath: string, smoothing: number = 0.25, steps: number = 200)

Was this helpful?

DemoImage

DemoImage is a helper class for simply visualizing easing functions. It contains 4 static methods for visualizing different functions of Easing objects.

PreviousPredefined Easing Objects

Last updated 4 years ago

Was this helpful?

Negative values are not rendered in the generated images

in(easing: Easing, outPath: string, steps: number = 200)

Creates a graph showing the curve created by the Easing object's in function and saves the image to the specified output path.

import { Easing, DemoImage } from 'eaz';

DemoImage.in(Easing.cubic, 'images/cubicIn.png');

images/cubicIn.png

out(easing: Easing, outPath: string, steps: number = 200)

Creates a graph showing the curve created by the Easing object's out function and saves the image to the specified output path.

import { Easing, DemoImage } from 'eaz';

DemoImage.out(Easing.cubic, 'images/cubicOut.png');

images/cubicOut.png

inOut(easing: Easing, outPath: string, steps: number = 200)

Creates a graph showing the curve created by the Easing object's inOut function and saves the image to the specified output path.

import { Easing, DemoImage } from 'eaz';

DemoImage.inOut(Easing.cubic, 'images/cubicInOut.png');

images/cubicInOut.png

interpolate(inEasing: Easing, outEasing: Easing, outPath: string, smoothing: number = 0.25, steps: number = 200)

Creates a graph showing the curve created by an in Easing object and an out Easing object. The transition between them is smoothed according to the smoothing value.

import { Easing, DemoImage } from 'eaz';

DemoImage.interpolate(
    Easing.cubic,
    Easing.noise(0.05, 5),
    'images/cubicNoiseInterpolate.png'
);

images/cubicNoiseInterpolate.png