# pixi-ease
a simple and powerful pixi.js easing/tweening/animating library
## features
* ease any pixi.js parameter, including tint (using a blend function or stepped)
* use any Penner function by name or any user-defined function
* support for generic number parameters
* change scale or skew using one parameter (e.g., scale: 5 changes both scale.x and scale.y)
* set default durations and easing function for all eases
* uses eventemitter3 for events for both the easing lists and individual eases
* tracks eases on DisplayObject and cleans up when DisplayObject is destroyed
* includes a default easing list so you don't have to instantiate for simple cases
* includes a shake parameter
* good test coverage
## Live Demo
[https://davidfig.github.io/pixi-ease/](https://davidfig.github.io/pixi-ease/)
## Migrating to v3
* changed default update loop to use requestAnimationFrame to remove the dependency on pixi.js
* to use PIXI.Ticker (like in v2), pass `new Ease({ ticker: PIXI.Ticker.shared })`
* ordinary usage should be unchanged
## Installation
yarn add pixi-ease
or [grab the latest release](https://github.com/davidfig/pixi-ease/releases/) and use it:
```html
<script src="/directory-to-file/pixi.js"></script>
<script src="/directory-to-file/pixi-ease.js"></script>
<!-- or <script type="module" src="/directory-to-file/pixi-ease.es.js"></script> -->
<script>
const ease = new Ease.Ease(options)
Ease.add(...)
// or Ease.ease.add(...)
</script>
```
## API Documentation
[https://davidfig.github.io/pixi-ease/jsdoc/](https://davidfig.github.io/pixi-ease/jsdoc)
## Simple Usage
```js
import * as PIXI from 'pixi.js'
import { Ease, ease } from 'pixi-ease'
const app = new PIXI.Application()
const test = app.stage.addChild(new PIXI.Sprite(PIXI.Texture.WHITE))
test.tint = 0x00ff00
const example = ease.add(test, { x: 20, y: 15, alpha: 0.25, rotation: 20, scale: 5, skewX: 0.25, blend: 0xff0000 } }, { reverse: true, duration: 2500, ease: 'easeInOutQuad' })
example.on('each', () => console.log('ease updated object during frame using PIXI.Ticker.'))
example.once('complete', () => console.log('move ease complete.'))
test.generic = 25
const generic = ease.add(test, { generic: 0 }, { duration: 1500, ease: 'easeOutQuad' })
generic.on('each', () => console.log(test.generic))
const secondEase = new Ease({ duration: 3000, wait: 1500, ease: 'easeInBack', repeat: 3 })
const test2 = app.stage.addChild(new PIXI.Sprite(PIXI.Texture.WHITE))
secondEase.add(test2, { tint: [0xff0000, 0x00ff00, 0x000ff], scaleX: 2 })
```
## Build Examples
I've included a bunch of build examples in the builds directory, including: [browserify](https://github.com/davidfig/pixi-ease/tree/master/builds/browserify), [rollup](https://github.com/davidfig/pixi-ease/tree/master/builds/rollup), [standalone (e.g., cdn)](https://github.com/davidfig/pixi-ease/tree/master/builds/standalone), [standalone (pixi.js v4)](https://github.com/davidfig/pixi-ease/tree/master/builds/standalone-v4), and [typescript](https://github.com/davidfig/pixi-ease/tree/master/builds/typescript).
## Tests
1. Clone repository
2. yarn install
3. yarn test (for Mocha test code)
4. yarn coverage (for Instanbul coverage)
### To run demo locally:
1. Clone repository
2. yarn install
3. yarn build
4. yarn dev
5. open browser to http://localhost:10001
### To run build examples:
1. Clone repository
2. yarn install
3. yarn build
4. yarn builds
5. yarn test-builds
6. open browser to http://localhost:5000
## Other Libraries
If you liked pixi-ease, please try my other open source libraries:
* [pixi-viewport](https://github.com/davidfig/pixi-viewport) - A highly configurable viewport/2D camera designed to work with pixi.js.
* [pixi-scrollbox](https://github.com/davidfig/pixi-scrollbox) - pixi.js scrollbox: a masked box that can scroll vertically or horizontally with scrollbars (uses pixi-ease)
* [intersects](https://github.com/davidfig/intersects) - a simple collection of 2d collision/intersects functions. Supports points, circles, lines, axis-aligned boxes, and polygons
## License
MIT License (c) 2019 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)
没有合适的资源?快使用搜索试试~ 我知道了~
pixi-ease:使用缓动函数的pixi.js动画库
共204个文件
html:145个
js:30个
map:9个
5星 · 超过95%的资源 需积分: 50 2 下载量 173 浏览量
2021-05-06
16:17:52
上传
评论
收藏 5.46MB ZIP 举报
温馨提示
像素化 一个简单而强大的pixi.js缓动/补间/动画库 特征 缓解任何pixi.js参数,包括色调(使用混合功能或阶梯式) 按名称使用任何Penner函数或任何用户定义的函数 支持通用数字参数 使用一个参数更改比例或偏斜度(例如,scale:5更改scale.x和scale.y) 设置默认持续时间和轻松功能 将eventemitter3用于缓动清单和个别缓动的事件 跟踪DisplayObject上的内容,并在销毁DisplayObject时进行清理 包括默认的缓动列表,因此您无需在简单情况下实例化 包括一个摇动参数 良好的测试覆盖率 现场演示 迁移到v3 更改了默认更新循环,以使用requestAnimationFrame删除对pixi.js的依赖 要使用PIXI.Ticker(如v2中一样),请传递new Ease({ ticker: PIXI.Ticker.shared })
资源详情
资源评论
资源推荐
收起资源包目录
pixi-ease:使用缓动函数的pixi.js动画库 (204个子文件)
bootstrap.min.css 118KB
main.css 6KB
prettify-tomorrow.css 2KB
prettify-jsdoc.css 1KB
glyphicons-halflings-regular.eot 20KB
.gitignore 30B
PIXI.Text.html 302KB
PIXI.extras.BitmapText.html 297KB
PIXI.mesh.NineSlicePlane.html 296KB
PIXI.particles.ParticleContainer.html 295KB
PIXI.extras.AnimatedSprite.html 295KB
PIXI.Graphics.html 295KB
PIXI.Sprite.html 295KB
PIXI.mesh.Plane.html 295KB
PIXI.mesh.Rope.html 295KB
PIXI.Container.html 295KB
PIXI.extras.TilingSprite.html 295KB
PIXI.mesh.Mesh.html 295KB
PIXI.html 291KB
PIXI.DisplayObject.html 290KB
PIXI.interaction.InteractionManager.html 282KB
PIXI.utils.html 255KB
PIXI.Texture.html 254KB
PIXI.WebGLRenderer.html 253KB
PIXI.CanvasRenderer.html 251KB
PIXI.BaseRenderTexture.html 251KB
Color.html 250KB
PIXI.VideoBaseTexture.html 250KB
PIXI.BaseTexture.html 249KB
PIXI.glCore.Texture.html 248KB
PIXI.RenderTexture.html 248KB
PIXI.settings.html 246KB
PIXI.SystemRenderer.html 244KB
PIXI.glCore.Framebuffer.html 243KB
PIXI.CanvasTinter.html 240KB
PIXI.glCore.VertexArrayObject.html 238KB
module.exports_module.exports.html 237KB
PIXI.GroupD8.html 233KB
PIXI.glCore.Buffer.html 232KB
3_module.exports_module.exports.html 232KB
203_module.exports_module.exports.html 232KB
198_module.exports.html 231KB
202_module.exports.html 231KB
PIXI.glCore.Shader.html 230KB
Entry.html 228KB
388_module.exports_module.exports.html 227KB
1_module.exports_module.exports.html 227KB
PIXI.prepare.BasePrepare.html 227KB
PIXI.prepare.CanvasPrepare.html 227KB
PIXI.prepare.WebGLPrepare.html 227KB
194_module.exports.html 227KB
200_module.exports.html 226KB
PIXI.loaders.html 226KB
195_module.exports.html 226KB
PIXI.ticker.html 226KB
201_module.exports.html 226KB
PIXI.glCore.shader.compileProgram.html 226KB
PIXI.loaders.Loader.html 226KB
199_module.exports.html 225KB
PIXI.glCore.createContext.html 225KB
PIXI.glCore.shader.generateUniformAccessObject.html 225KB
PIXI.glCore.shader.extractAttributes.html 225KB
PIXI.TextMetrics-FontMetrics.html 225KB
PIXI.glCore.shader.extractUniforms.html 225KB
PIXI.Application.html 224KB
PIXI.TextStyle.html 224KB
PIXI.glCore.shader.mapSize.html 224KB
PIXI.glCore.shader.defaultValue.html 224KB
PIXI.filters.ColorMatrixFilter.html 224KB
PIXI.accessibility.AccessibilityManager.html 224KB
PIXI.filters.FXAAFilter.html 224KB
PIXI.filters.DisplacementFilter.html 224KB
PIXI.TextMetrics.html 224KB
PIXI.extras.MovieClip.html 223KB
PIXI.ticker.Ticker.html 223KB
PIXI.Transform.html 223KB
PIXI.PrimitiveShader.html 223KB
PIXI.ObservablePoint.html 223KB
PIXI.ObjectRenderer.html 223KB
PIXI.TransformStatic.html 223KB
PIXI.GraphicsRenderer.html 223KB
PIXI.extras.TilingSpriteRenderer.html 223KB
PIXI.TextureGarbageCollector.html 223KB
PIXI.filters.BlurFilter.html 223KB
PIXI.MeshRenderer.html 223KB
PIXI.SpriteMaskFilter.html 223KB
PIXI.RoundedRectangle.html 223KB
PIXI.Shader.html 223KB
PIXI.filters.BlurXFilter.html 223KB
PIXI.filters.BlurYFilter.html 223KB
PIXI.CountLimiter.html 223KB
PIXI.extract.CanvasExtract.html 223KB
PIXI.extract.WebGLExtract.html 223KB
PIXI.StencilManager.html 223KB
PIXI.filters.NoiseFilter.html 223KB
PIXI.filters.VoidFilter.html 223KB
PIXI.FilterManager.html 223KB
PIXI.ParticleShader.html 223KB
PIXI.Rectangle.html 223KB
PIXI.TimeLimiter.html 223KB
共 204 条
- 1
- 2
- 3
JinTommy
- 粉丝: 39
- 资源: 4550
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1