dat.gui.ease.tweenjs
v0.2.5
Published
Allows to edit tween.js easings in dat.GUI
Downloads
1
Maintainers
Readme
dat.GUI.Ease.TweenJS
Provides support for tween.js easings.
Example usage:
import * as dat from 'dat.gui';
import { extend } from 'dat.gui.ease';
import TweenJSMiddleware, { CustomEase } from 'dat.gui.ease.tweenjs';
import { Easing } from '@tweenjs/tween.js';
extend(dat).use(
new TweenJSMiddleware()
);
const gui = new dat.GUI();
const config = {
ease: Easing.Sinusoidal.Out,
customEase: new CustomEase("M 0,0 C 0.1,0.4 0.1,0.4 0.5,0.5 0.9,0.6 0.9,0.6 1,1")
};
gui.addEase(config, "ease");
gui.addEase(config, "customEase");
Installation
npm install --save @tweenjs/tween.js@^18.0.0
npm install --save-dev dat.gui dat.gui.ease dat.gui.ease.tweenjs
Use in the project
- File include:
<script type="text/javascript" src="https://unpkg.com/dat.gui.ease.tweenjs@latest/dist/dat.gui.ease.tweenjs.min.js"></script>
<script>
const middleware = new datGuiEaseTweenJS.Middleware();
</script>
- ES6 module
import TweenJSMiddleware from 'dat.gui.ease.tweenjs';
// or
import { Middleware as TweenJSMiddleware } from 'dat.gui.ease.tweenjs';
const middleware = new TweenJSMiddleware();
- CommonJS
const datGuiEaseTweenJS = require('dat.gui.ease.tweenjs');
const middleware = new datGuiEaseTweenJS.Middleware();